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.0 Connection: keep-alive header should not be removed from response #9797

Closed
jusmaki opened this issue Jan 23, 2020 · 2 comments · Fixed by #9843
Closed

HTTP/1.0 Connection: keep-alive header should not be removed from response #9797

jusmaki opened this issue Jan 23, 2020 · 2 comments · Fixed by #9843
Assignees

Comments

@jusmaki
Copy link

jusmaki commented Jan 23, 2020

Title: HTTP/1.0 Connection: keep-alive requests are not processed correctly

Description:
The envoy-proxy removes the connection-header for HTTP/1.0 clients causing some HTTP/1.0 clients like apache-bench to stuck when keep-alives are enabled because the envoy-proxy does not copy the connection -header value from the client request to the response.

If envoy is configured to support HTTP/1.0 it should copy and respect the Connection-header value from the client request to the response.
So the rules for HTTP/1.0 client connections should be:

  • If a client like Apache Bench that is HTTP 1.0 doesn't provide the connection: keep-alive header the socket connection should be closed after replying with Connection: close header.
  • If the client provides the connection: keep-alive header the socket should remain open and Connection: keep-alive header should be returned.

Repro steps:
Install apache-bench (for example in ubuntu "sudo apt get apache2-utils", setup envoy to proxy requests to some upstream server and enable support for HTTP/1.0 with accept_http_10: true,
send requests with apache-bench e.g. "ab -v 9 -n 2 -k http://localhost:10000" and see that the connection is stuck because the envoy does not return connection header.

Relevant Links:
See: https://tools.ietf.org/html/rfc2068#section-19.7.1

@mattklein123
Copy link
Member

cc @alyssawilk @PiotrSikora

@alyssawilk
Copy link
Contributor

Yeah, looks like a bug to me. We correctly perform connection close or not based on request headers, but don't do the inverted "send keep alive if there's no explicit close" we ought to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants