Skip to content

Commit be34b45

Browse files
committed
- update filter
1 parent c80ffe7 commit be34b45

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

src/Request.php

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
*/
2727
class Request {
2828

29+
30+
2931
/**
3032
* App context for this request.
3133
*
@@ -722,10 +724,17 @@ private function is_valid_http_content_type(): bool {
722724
return false;
723725
}
724726

725-
/**
726-
* Allow graphql to validate custom content types for HTTP POST requests
727-
*/
728-
return apply_filters( 'graphql_is_valid_http_content_type', 0 === stripos( $content_type, 'application/json' ), $content_type, $_SERVER['REQUEST_METHOD'] );
727+
$is_valid = 0 === stripos( $content_type, 'application/json' );
728+
729+
/**
730+
* Allow graphql to validate custom content types for HTTP POST requests
731+
*
732+
* @param bool $is_valid Whether the content type is valid
733+
* @param string $content_type The content type header value that was received
734+
*
735+
* @since todo
736+
*/
737+
return (bool) apply_filters( 'graphql_is_valid_http_content_type', $is_valid, $content_type );
729738
}
730739

731740
/**

0 commit comments

Comments
 (0)