forked from pgjones/hypercorn
-
Notifications
You must be signed in to change notification settings - Fork 1
Rebase with hypercorn 0.16.0 #1
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
Open
AlanZhang2002
wants to merge
21
commits into
urllib3:urllib3-changes
Choose a base branch
from
AlanZhang2002:urllib3-changes-0.16.0
base: urllib3-changes
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Rebase with hypercorn 0.16.0 #1
AlanZhang2002
wants to merge
21
commits into
urllib3:urllib3-changes
from
AlanZhang2002:urllib3-changes-0.16.0
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Otherwise the task will persist and attempt to close an already closed connection.
This will cause HTTP/1 and HTTP/2 requests to close when the limit has been reached. This matches nginx's mitigation against the rapid reset HTTP/2 attack.
This reverts commit 4854ffd. It doesn't fix the issue and creates additional reported issues.
This properly punches through 431 status codes
… also exit with a non-zero exit code.
The response body is closed if it has a close method as per PEP 3333. In addition the response headers are only sent when the first response body byte is available to send. Finally, an error is raised if start_response has not been called by the app.
This allows for Hypercorn to be used behind a proxy with the headers being "fixed" such that the proxy is not present as far as the app is concerned. This makes it easier to write applications that run behind proxies. Note I've defaulted to legacy mode as AWS's load balancers don't support the modern Forwarded header and I assume that makes up a large percentage of real world usage.
This matches other examples and the WSGI specification.
This is useful as a "solution" to memory leaks in apps as it ensures that after the max requests have been handled the worker will restart hence freeing any memory leak. The options match those used by Gunicorn. This also ensures that the workers self-heal such that if a worker crashes it will be restored.
There is a race condition being hit in the autobahn compliance tests whereby the client closes the stream and the server responds with an acknowledgement. Whilst the server responds the app sends a message, which now errors as the WSConnection state is closed. As the state is managed by the WSStream, rather than the WSConnection it makes sense to ignore these errors.
The ssl name clashes with the ssl module name and I intend to reuse this variable to carry information about the ASGI TLS extension.
The dictionary will carry information for the TLS ASGI extension.
It makes the underlying transport available, and depends on the actual backend. urllib3 needs it to implement CONNECT.
This makes debugging much easier than the current silent behavior.
not sure if i did this part right tbh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Tied with https://github.com/urllib3/urllib3-ghsa-653g-f933-mc5q/pull/1 for testing urllib3 with hypercorn 0.16.0