Skip to content

Commit dc19345

Browse files
committed
fix(http2): strip content-length header in response to CONNECT requests
1 parent b990031 commit dc19345

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/proto/h2/server.rs

+3
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,9 @@ where
485485
me.reply.send_reset(h2::Reason::INTERNAL_ERROR);
486486
return Poll::Ready(Err(crate::Error::new_user_header()));
487487
}
488+
if res.headers_mut().remove(::http::header::CONTENT_LENGTH).is_some() {
489+
warn!("succesful response to CONNECT request disallows content-length header");
490+
}
488491
let send_stream = reply!(me, res, false);
489492
connect_parts.pending.fulfill(Upgraded::new(
490493
H2Upgraded {

0 commit comments

Comments
 (0)