@@ -49,7 +49,7 @@ use juniper::{
49
49
} ;
50
50
use std:: { collections:: HashMap , str, sync:: Arc } ;
51
51
use tokio:: task;
52
- use warp:: { body, filters:: BoxedFilter , header , http, query, Filter } ;
52
+ use warp:: { body, filters:: BoxedFilter , http, query, Filter } ;
53
53
54
54
/// Make a filter for graphql queries/mutations.
55
55
///
@@ -142,10 +142,6 @@ where
142
142
}
143
143
} ;
144
144
let post_json_filter = warp:: post ( )
145
- . and ( header:: exact_ignore_case (
146
- "content-type" ,
147
- "application/json" ,
148
- ) )
149
145
. and ( context_extractor. clone ( ) )
150
146
. and ( body:: json ( ) )
151
147
. and_then ( handle_post_json_request) ;
@@ -164,10 +160,6 @@ where
164
160
. then ( |res| async { Ok :: < _ , warp:: Rejection > ( build_response ( res) ) } )
165
161
} ;
166
162
let post_graphql_filter = warp:: post ( )
167
- . and ( header:: exact_ignore_case (
168
- "content-type" ,
169
- "application/graphql" ,
170
- ) )
171
163
. and ( context_extractor. clone ( ) )
172
164
. and ( body:: bytes ( ) )
173
165
. and_then ( handle_post_graphql_request) ;
@@ -233,10 +225,6 @@ where
233
225
. map_err ( |e : task:: JoinError | warp:: reject:: custom ( JoinError ( e) ) )
234
226
} ;
235
227
let post_json_filter = warp:: post ( )
236
- . and ( header:: exact_ignore_case (
237
- "content-type" ,
238
- "application/json" ,
239
- ) )
240
228
. and ( context_extractor. clone ( ) )
241
229
. and ( body:: json ( ) )
242
230
. and_then ( handle_post_json_request) ;
@@ -259,10 +247,6 @@ where
259
247
. map_err ( |e : task:: JoinError | warp:: reject:: custom ( JoinError ( e) ) )
260
248
} ;
261
249
let post_graphql_filter = warp:: post ( )
262
- . and ( header:: exact_ignore_case (
263
- "content-type" ,
264
- "application/graphql" ,
265
- ) )
266
250
. and ( context_extractor. clone ( ) )
267
251
. and ( body:: bytes ( ) )
268
252
. and_then ( handle_post_graphql_request) ;
@@ -913,7 +897,7 @@ mod tests_http_harness {
913
897
self . make_request (
914
898
warp:: test:: request ( )
915
899
. method ( "POST" )
916
- . header ( "content-type" , "application/json" )
900
+ . header ( "content-type" , "application/json; charset=utf-8 " )
917
901
. path ( url)
918
902
. body ( body) ,
919
903
)
@@ -923,7 +907,7 @@ mod tests_http_harness {
923
907
self . make_request (
924
908
warp:: test:: request ( )
925
909
. method ( "POST" )
926
- . header ( "content-type" , "application/graphql" )
910
+ . header ( "content-type" , "application/graphql; charset=utf-8 " )
927
911
. path ( url)
928
912
. body ( body) ,
929
913
)
0 commit comments