Echo/reply working

This commit is contained in:
2021-05-16 17:28:14 +02:00
parent c3fe62275f
commit 124ff2ef94
4 changed files with 59 additions and 4 deletions

View File

@ -5,7 +5,6 @@ pub fn connection_handler(client: &mut http::HttpStream, req: &http::Request) {
let mut res = http::Response::new();
if let http::Method::GET = req.method {
res.status(501);
} else {
res.status(405);
res.add_header("Allow", "GET");
@ -13,5 +12,7 @@ pub fn connection_handler(client: &mut http::HttpStream, req: &http::Request) {
return;
}
// TODO implement websocket
res.status(501);
res.send(&mut client.stream);
}