File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change 1
1
use std:: convert:: TryFrom ;
2
+ use std:: env;
2
3
use std:: pin:: Pin ;
3
4
use std:: task:: Context ;
4
5
use std:: task:: Poll ;
@@ -326,12 +327,16 @@ where
326
327
let headers = req. headers ( ) ;
327
328
let content_type = headers. get ( "content-type" ) ;
328
329
329
- if method == Method :: POST && ( content_type. is_none ( ) ) {
330
- return self . handle_requests_without_content_type ( ) . boxed ( ) ;
331
- }
330
+ let less_strict_graphql_compliance = env:: var ( "LESS_STRICT_GRAPHQL_COMPLIANCE" ) . is_ok ( ) ;
331
+
332
+ if !less_strict_graphql_compliance {
333
+ if method == Method :: POST && ( content_type. is_none ( ) ) {
334
+ return self . handle_requests_without_content_type ( ) . boxed ( ) ;
335
+ }
332
336
333
- if method == Method :: POST && !self . has_request_body ( & req) {
334
- return self . handle_requests_without_body ( ) . boxed ( ) ;
337
+ if method == Method :: POST && !self . has_request_body ( & req) {
338
+ return self . handle_requests_without_body ( ) . boxed ( ) ;
339
+ }
335
340
}
336
341
337
342
let is_mutation = req
You can’t perform that action at this time.
0 commit comments