Skip to content

Commit 2ebcf9b

Browse files
committed
chore: revert back new service instantiation
1 parent b6e5550 commit 2ebcf9b

File tree

1 file changed

+6
-21
lines changed

1 file changed

+6
-21
lines changed

server/http/src/server.rs

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -67,27 +67,12 @@ where
6767
let graphql_runner = self.graphql_runner.clone();
6868
let node_id = self.node_id.clone();
6969
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+
))
9176
});
9277

9378
// Create a task to run the server and handle HTTP requests

0 commit comments

Comments
 (0)