Skip to content
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

Merged
merged 2 commits into from
Nov 23, 2016

Conversation

mattklein123
Copy link
Member

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.

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.
@mattklein123
Copy link
Member Author

@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
Copy link
Member

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 ..

Copy link
Member Author

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)) {
Copy link
Member

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 ?

Copy link
Member Author

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.

@mattklein123 mattklein123 merged commit 70a24c3 into master Nov 23, 2016
@mattklein123 mattklein123 deleted the conn_close branch November 23, 2016 20:16
PiotrSikora added a commit to PiotrSikora/envoy that referenced this pull request Oct 10, 2019
PiotrSikora pushed a commit to PiotrSikora/envoy that referenced this pull request Aug 2, 2020
mattklein123 pushed a commit that referenced this pull request Apr 15, 2021
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]>
douglas-reid referenced this pull request in douglas-reid/envoy Apr 19, 2021
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]>
gokulnair pushed a commit to gokulnair/envoy that referenced this pull request May 6, 2021
…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]>
jpsim pushed a commit that referenced this pull request Nov 28, 2022
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]>
jpsim pushed a commit that referenced this pull request Nov 29, 2022
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]>
arminabf pushed a commit to arminabf/envoy that referenced this pull request Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants