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

Don't use keep-alive connections in HTTP/1.1 mode #2397

Closed
davidism opened this issue Apr 24, 2022 · 0 comments
Closed

Don't use keep-alive connections in HTTP/1.1 mode #2397

davidism opened this issue Apr 24, 2022 · 0 comments
Assignees
Milestone

Comments

@davidism
Copy link
Member

Python's built-in http.server, which Werkzeug's dev server extends, does not drain the request body stream before the next request begins. If the view function didn't read the request body, then it would result in the body appearing prepended to the next request method, like {}GET. Not reading the body is apparently common, perhaps when first developing a view. When we enabled HTTP/1.1 by default, many more users began seeing this issue.

Disable keep-alive connections. The original request for HTTP/1.1 mode was for chunked responses, which will continue to work.

While they technically should report it to Python, they instead reported it repeatedly to Werkzeug and Flask since that's what they were using. If someone wants to report this to Python, and they fix it, please open a PR here to re-enable keep-alive connections.

Remember, the development server should never be used outside development. It is not designed to be particularly secure, stable, or efficient.

@davidism davidism added this to the 2.1.2 milestone Apr 24, 2022
@davidism davidism self-assigned this Apr 24, 2022
lnielsen added a commit to lnielsen/invenio-app-rdm that referenced this issue Apr 26, 2022
* Werkzeug 2.1.0/1 by default enabled chunked transfer encoding, but
  this caused issue for the development server.
  See pallets/werkzeug#2397
lnielsen added a commit to inveniosoftware/invenio-app-rdm that referenced this issue Apr 26, 2022
* Werkzeug 2.1.0/1 by default enabled chunked transfer encoding, but
  this caused issue for the development server.
  See pallets/werkzeug#2397
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant