fix(server): use case-insensitive comparison for Expect: 100-continue (#2709)
According to rfc2616#section-14.20 the header value is case-insensitive. Certain clients send the expectation as `100-Continue` and this should be handled by the server. Closes #2708
This commit is contained in:
@@ -271,7 +271,10 @@ impl Http1Transaction for Server {
|
||||
}
|
||||
}
|
||||
header::EXPECT => {
|
||||
expect_continue = value.as_bytes() == b"100-continue";
|
||||
// According to https://datatracker.ietf.org/doc/html/rfc2616#section-14.20
|
||||
// Comparison of expectation values is case-insensitive for unquoted tokens
|
||||
// (including the 100-continue token)
|
||||
expect_continue = value.as_bytes().eq_ignore_ascii_case(b"100-continue");
|
||||
}
|
||||
header::UPGRADE => {
|
||||
// Upgrades are only allowed with HTTP/1.1
|
||||
|
||||
Reference in New Issue
Block a user