File tree Expand file tree Collapse file tree 1 file changed +6
-21
lines changed Expand file tree Collapse file tree 1 file changed +6
-21
lines changed Original file line number Diff line number Diff line change @@ -67,27 +67,12 @@ where
67
67
let graphql_runner = self . graphql_runner . clone ( ) ;
68
68
let node_id = self . node_id . clone ( ) ;
69
69
let new_service = make_service_fn ( move |_| {
70
- ok :: < _ , Error > ( service_fn ( move |req : Request < Body > | {
71
- match (
72
- req. method ( ) ,
73
- req. headers ( ) . get ( hyper:: header:: CONTENT_LENGTH ) ,
74
- ) {
75
- ( & Method :: POST , Some ( length) ) if length == "0" => {
76
- let mut res = Response :: new ( Body :: empty ( ) ) ;
77
- * res. status_mut ( ) = StatusCode :: BAD_REQUEST ;
78
- ok :: < _ , Error > ( res)
79
- }
80
- _ => {
81
- let service = GraphQLService :: new (
82
- logger_for_service. clone ( ) ,
83
- graphql_runner. clone ( ) ,
84
- ws_port,
85
- node_id. clone ( ) ,
86
- ) ;
87
- futures03:: future:: ok :: < _ , Error > ( service)
88
- }
89
- }
90
- } ) )
70
+ futures03:: future:: ok :: < _ , Error > ( GraphQLService :: new (
71
+ logger_for_service. clone ( ) ,
72
+ graphql_runner. clone ( ) ,
73
+ ws_port,
74
+ node_id. clone ( ) ,
75
+ ) )
91
76
} ) ;
92
77
93
78
// Create a task to run the server and handle HTTP requests
You can’t perform that action at this time.
0 commit comments