Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 10 additions & 12 deletions src/proto/h1/role.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,20 +188,18 @@ impl Http1Transaction for Server {
headers_len = req.headers.len();
}
Ok(httparse::Status::Partial) => return Ok(None),
Err(err) => {
return Err(match err {
// if invalid Token, try to determine if for method or path
httparse::Error::Token => {
if req.method.is_none() {
Parse::Method
} else {
debug_assert!(req.path.is_none());
Parse::Uri
}
// if invalid Token, try to determine if for method or path
Err(httparse::Error::Token) => {
return Err({
if req.method.is_none() {
Parse::Method
} else {
debug_assert!(req.path.is_none());
Parse::Uri
}
other => other.into(),
});
})
}
Err(err) => return Err(err.into()),
}
};

Expand Down