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

Support extra_headers for WS accept message #1293

Merged
merged 3 commits into from
Jan 6, 2022

Conversation

matiuszka
Copy link
Contributor

The extra_headers support for WS accept message.
According to ASGI spec: https://asgi.readthedocs.io/en/latest/specs/www.html#accept-send-event

@matiuszka
Copy link
Contributor Author

I need to fix the pipeline.

@Kludex
Copy link
Sponsor Member

Kludex commented Dec 15, 2021

Thanks for the PR @matiuszka ! 🎉

Copy link
Sponsor Member

@Kludex Kludex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @matiuszka ! :)

Let's wait for encode/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 🙏

@Kludex Kludex merged commit 867de39 into encode:master Jan 6, 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")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just small syntax comment:
for name, value in message["headers"]
due to already checking if "headers" in message

Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

true, PR welcome :P

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants