Support extra_headers for WS accept message#1293
Merged
Kludex merged 3 commits intoKludex:masterfrom Jan 6, 2022
Merged
Conversation
Contributor
Author
|
I need to fix the pipeline. |
799bce2 to
8530dbd
Compare
Kludex
reviewed
Dec 15, 2021
Owner
|
Thanks for the PR @matiuszka ! 🎉 |
Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>
Kludex
approved these changes
Jan 3, 2022
Owner
There was a problem hiding this comment.
Thanks @matiuszka ! :)
Let's wait for Kludex/starlette#1361 to be fixed, and then we can merge this one :)
NOTE: Starlette PR is actually not a requisite to have this merged, but I'd like to merge them together 🙏
t1waz
reviewed
Jan 21, 2022
| # ASGI spec requires bytes | ||
| # But for compability we need to convert it to strings | ||
| (name.decode("latin-1"), value.decode("latin-1")) | ||
| for name, value in message.get("headers") |
Contributor
There was a problem hiding this comment.
just small syntax comment:
for name, value in message["headers"]
due to already checking if "headers" in message
Contributor
Author
There was a problem hiding this comment.
@t1waz are you going to open PR for that? I can do that also.
Kludex
added a commit
to sephioh/uvicorn
that referenced
this pull request
Oct 29, 2022
* Support `extra_headers` for WS `accept` message * Update uvicorn/protocols/websockets/websockets_impl.py Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com> Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>
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
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.
The
extra_headerssupport for WSacceptmessage.According to ASGI spec: https://asgi.readthedocs.io/en/latest/specs/www.html#accept-send-event