-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
http/1.1: correctly handle connection header for for incoming requests #239
Conversation
We didn't previously handle the Connection: close header for incoming HTTP/1.1 requests. This commit fixes that. There are also some perf related changes/cleanup in this commit also: 1) Remove synthetic :version header and replace with an explicit codec protocol method. 2) Remove the x-envoy-protocol-version response header. This was used for debugging when we first rolled out HTTP/2 support and no longer has any real value.
@lyft/network-team |
@@ -175,7 +174,7 @@ Network::FilterStatus ConnectionManagerImpl::onData(Buffer::Instance& data) { | |||
// The HTTP/1.1 codec will pause dispatch after a single message is complete. We want to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: it's also the case for HTTP/1.0, something like non HTTP/2 codec ..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will fix
const HeaderString& codec_version = request_headers_->Version()->value(); | ||
if (!(codec_version == "HTTP/1.1" || codec_version == "HTTP/2")) { | ||
Protocol protocol = connection_manager_.codec_->protocol(); | ||
if (!(protocol == Protocol::Http11 || protocol == Protocol::Http2)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not directly, protocol == Protocol::Http10 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just in case we add something else in the future, but the chance of that happening is basicaly zero so I will fix it.
Signed-off-by: Piotr Sikora <[email protected]>
Fix for CVE-2021-28683 (crash when peer sends an SSL Alert with an unknown code) Signed-off-by: Greg Greenway <[email protected]> Co-authored-by: Christoph Pakulski <[email protected]> Signed-off-by: Tony Allen <[email protected]>
Fix for CVE-2021-28683 (crash when peer sends an SSL Alert with an unknown code) Signed-off-by: Greg Greenway <[email protected]> Co-authored-by: Christoph Pakulski <[email protected]> Signed-off-by: Tony Allen <[email protected]> Signed-off-by: Douglas Reid <[email protected]>
…oyproxy#239) Fix for CVE-2021-28683 (crash when peer sends an SSL Alert with an unknown code) Signed-off-by: Greg Greenway <[email protected]> Co-authored-by: Christoph Pakulski <[email protected]> Signed-off-by: Tony Allen <[email protected]> Signed-off-by: Gokul Nair <[email protected]>
Restricting subclassing and visibility of these types. Risk Level: None Testing: CI Signed-off-by: Michael Rebello <[email protected]> Signed-off-by: JP Simard <[email protected]>
Restricting subclassing and visibility of these types. Risk Level: None Testing: CI Signed-off-by: Michael Rebello <[email protected]> Signed-off-by: JP Simard <[email protected]>
We didn't previously handle the Connection: close header for incoming
HTTP/1.1 requests. This commit fixes that.
There are also some perf related changes/cleanup in this commit also:
protocol method.
for debugging when we first rolled out HTTP/2 support and no longer
has any real value.