Skip to content

Commit 6634c21

Browse files
authored
fix: allow configured managed edge resolved locally (#2664)
1 parent 1c5fc41 commit 6634c21

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

includes/Bootstrap/SuperdavAiProviderHandler.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,11 @@ private static function is_configured_loopback_url( string $host, string $url ):
100100
$base_host = strtolower( (string) ( $base_parts['host'] ?? '' ) );
101101
$request_host = strtolower( (string) ( $request_parts['host'] ?? '' ) );
102102
$filter_host = strtolower( trim( $host, '.' ) );
103-
if ( ! in_array( $base_host, array( '127.0.0.1', 'localhost' ), true )
104-
|| $request_host !== $base_host
103+
// Production routes api.sdaiagent.com to the local managed edge (127.0.0.1).
104+
// WordPress therefore classifies the public hostname as local and rejects it
105+
// before the SDK can send the request. The configured exact host is safe to
106+
// allow here; the path and scheme checks below still constrain the exception.
107+
if ( $request_host !== $base_host
105108
|| $filter_host !== $base_host
106109
) {
107110
return false;

0 commit comments

Comments
 (0)