- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 754
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
Support the WebSocket Denial Response ASGI extension #1916
Merged
+447
−15
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
1a32e1a
create test for websocket responses
kristjanvalur 9c37602
update websockets protocol
kristjanvalur ad649ed
update wsproto
kristjanvalur ed7a4dd
add multi-body response test
kristjanvalur 8f83cab
Update tests/protocols/test_websocket.py
kristjanvalur 4d74d4d
fix tests
kristjanvalur 3996b48
fix mypy problems
kristjanvalur 4390fb7
Simply fail if application passes an invalid status code
kristjanvalur 4f7f1f4
Add a test for invalid message order
kristjanvalur 2f47ae4
Update uvicorn/protocols/websockets/websockets_impl.py
kristjanvalur 7a745e4
Fix initial response error handling and unit-test
kristjanvalur c9586bb
Add a similar missing-body test
kristjanvalur 4047a3a
Use httpx to check rejection response body
kristjanvalur 46d654d
Add test showing how content-length/transfer-encoding is automaticall…
kristjanvalur d2944e0
Do not send the response start until the first response body is received
kristjanvalur 8c9db89
Update unittest to use protocol fixture
kristjanvalur 198be2e
Check wsproto response status code
kristjanvalur 946eb7c
Fix linter
Kludex 95f3b03
Send response headers as soon as we have them
Kludex db586a1
Add test to make sure a single `websocket.http.response.start` is sent
Kludex f81f3f0
Modify the conditionals on wsproto
Kludex 0876494
lint
Kludex 798613a
Remove handshake_complete
Kludex File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Add test showing how content-length/transfer-encoding is automaticall…
…y handled.
commit 46d654d47be7cf4dff59966668c133cbb85c79b1
There are no files selected for viewing
This file contains 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
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.
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.
It makes sense for WebSockets to add the
content-length
, since we can't have a chunked one there.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.
well, this is only about what happens if the app doesn't provide a content-length and only provides the raw body data. the defaults for these two protocols are different. Technically, you can provide chunked data over the websockets: The app, provides the "chunked" header, and then provides the chunks, with the appropriate chunk headers (as an application should do if it provides that header (I think). I think that nowadays it is rare for an application to specify content length or transfer encoding...