Skip to content

Commit

Permalink
refactor(server): simplify :method POST check (#1787)
Browse files Browse the repository at this point in the history
  • Loading branch information
mxinden authored Apr 2, 2024
1 parent 6860687 commit 0751429
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions neqo-bin/src/server/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -336,13 +336,10 @@ impl HttpServer for SimpleServer {
} => {
qdebug!("Headers (request={stream} fin={fin}): {headers:?}");

let post = if let Some(method) = headers.iter().find(|&h| h.name() == ":method")
if headers
.iter()
.any(|h| h.name() == ":method" && h.value() == "POST")
{
method.value() == "POST"
} else {
false
};
if post {
self.posts.insert(stream, 0);
continue;
}
Expand Down

0 comments on commit 0751429

Please sign in to comment.