Skip to content

Commit 67a4a49

Browse files
fix(http2): strip content-length header in response to CONNECT requests (#3748)
s
1 parent b990031 commit 67a4a49

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/proto/h2/server.rs

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

0 commit comments

Comments
 (0)