Skip to content

Commit

Permalink
fix(http2): strip content-length header in response to CONNECT requests
Browse files Browse the repository at this point in the history
  • Loading branch information
SabrinaJewson committed Aug 28, 2024
1 parent b990031 commit dc19345
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/proto/h2/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,9 @@ 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!("succesful 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 dc19345

Please sign in to comment.