Skip to content

Commit

Permalink
Update is_graphql_request to match with upstream one
Browse files Browse the repository at this point in the history
  • Loading branch information
esamattis committed Dec 16, 2019
1 parent da99360 commit 3b1d4f1
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/Loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,7 @@ function is_graphql_request()
if ( isset( $_SERVER['HTTP_HOST'] ) && isset( $_SERVER['REQUEST_URI'] ) ) {
$haystack = wp_unslash( $_SERVER['HTTP_HOST'] )
. wp_unslash( $_SERVER['REQUEST_URI'] );
$needle = \home_url( \WPGraphQL\Router::$route );

$needle = site_url( self::$route );
// Strip protocol.
$haystack = preg_replace( '#^(http(s)?://)#', '', $haystack );
$needle = preg_replace( '#^(http(s)?://)#', '', $needle );
Expand Down

0 comments on commit 3b1d4f1

Please sign in to comment.