Skip to content

Commit

Permalink
fix(http2): strip content-length header in response to CONNECT reques…
Browse files Browse the repository at this point in the history
…ts (#3748)

s
  • Loading branch information
SabrinaJewson authored Aug 29, 2024
1 parent b990031 commit 67a4a49
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/proto/h2/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,13 @@ where
me.reply.send_reset(h2::Reason::INTERNAL_ERROR);
return Poll::Ready(Err(crate::Error::new_user_header()));
}
if res
.headers_mut()
.remove(::http::header::CONTENT_LENGTH)
.is_some()
{
warn!("successful response to CONNECT request disallows content-length header");
}
let send_stream = reply!(me, res, false);
connect_parts.pending.fulfill(Upgraded::new(
H2Upgraded {
Expand Down

0 comments on commit 67a4a49

Please sign in to comment.