File tree Expand file tree Collapse file tree 1 file changed +1
-13
lines changed Expand file tree Collapse file tree 1 file changed +1
-13
lines changed Original file line number Diff line number Diff line change @@ -189,26 +189,14 @@ impl QueryResults {
189
189
self . results . push ( other) ;
190
190
}
191
191
192
- fn has_query_parameter ( & self , query : Option < & str > ) -> bool {
193
- if let Some ( query_str) = query {
194
- for param in query_str. split ( '&' ) {
195
- let param_parts: Vec < & str > = param. splitn ( 2 , '=' ) . collect ( ) ;
196
- if param_parts. len ( ) == 2 && param_parts[ 0 ] == "query" {
197
- return true ;
198
- }
199
- }
200
- }
201
- false
202
- }
203
-
204
192
pub fn as_http_response < T : From < String > > ( & self ) -> http:: Response < T > {
205
193
let status_code = http:: StatusCode :: OK ;
206
194
207
195
let json =
208
196
serde_json:: to_string ( self ) . expect ( "Failed to serialize GraphQL response to JSON" ) ;
209
197
210
198
http:: Response :: builder ( )
211
- . status ( StatusCode :: BAD_REQUEST )
199
+ . status ( status_code )
212
200
. header ( ACCESS_CONTROL_ALLOW_ORIGIN , "*" )
213
201
. header ( ACCESS_CONTROL_ALLOW_HEADERS , "Content-Type, User-Agent" )
214
202
. header ( ACCESS_CONTROL_ALLOW_METHODS , "GET, OPTIONS, POST" )
You can’t perform that action at this time.
0 commit comments