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

Backward compatibility considering that people may have websockets<10.4 #1747

Merged
merged 2 commits into from Nov 1, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions uvicorn/protocols/websockets/websockets_impl.py
Expand Up @@ -103,14 +103,14 @@ def __init__(
max_size=self.config.ws_max_size,
ping_interval=self.config.ws_ping_interval,
ping_timeout=self.config.ws_ping_timeout,
server_header=None,
extensions=extensions,
logger=logging.getLogger("uvicorn.error"),
extra_headers=[
(name.decode("latin-1"), value.decode("latin-1"))
for name, value in server_state.default_headers
],
)
self.server_header = None
self.extra_headers = [
Copy link
Contributor Author

@iudeen iudeen Oct 31, 2022

Choose a reason for hiding this comment

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

Tests test_no_server_headers and test_multiple_server_header would fail in versions websockets<10.4.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

image

(name.decode("latin-1"), value.decode("latin-1"))
for name, value in server_state.default_headers
]

def connection_made( # type: ignore[override]
self, transport: asyncio.Transport
Expand Down