Skip to content

Commit

Permalink
simple: Remove check for hop-by-hop headers
Browse files Browse the repository at this point in the history
This check assumed that the headers would be lowercase, which is not
(yet) guaranteed by the WAS protocol or the implementation itself.
Fortunately this check is redundant since the role of a WAS server
requires that hop-by-hop headers will not be sent to it (assuming a
well-behaved WAS client), as they are not to be forwarded by
proxies (RFC2616, 13.5.1).
http_header_is_hop_by_hop also checked for Content-Length, which
is explicitly excluded by the WAS protocol (and replaced by a
LENGTH message).
  • Loading branch information
pfirsich committed Nov 15, 2024
1 parent 8ffebb9 commit 39f81bd
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/simple.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -2034,9 +2034,8 @@ bool
was_simple_copy_all_headers(struct was_simple *w)
{
for (const auto &i : w->request.headers)
if (!http_header_is_hop_by_hop(i.first.c_str()))
if (!was_simple_set_header(w, i.first.c_str(), i.second.c_str()))
return false;
if (!was_simple_set_header(w, i.first.c_str(), i.second.c_str()))
return false;

return true;
}
Expand Down

0 comments on commit 39f81bd

Please sign in to comment.