From 49353976115f8e1792661d2dc12c51820c2e1c73 Mon Sep 17 00:00:00 2001 From: Justin Yo Date: Fri, 24 Jul 2020 19:11:10 +0900 Subject: [PATCH 1/2] Fixed typo in websocket doc (#1009) Co-authored-by: YeohJerWei --- docs/websockets.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/websockets.md b/docs/websockets.md index ab6a0532a0..85ec5dbbd3 100644 --- a/docs/websockets.md +++ b/docs/websockets.md @@ -39,7 +39,7 @@ For example: `websocket.headers['sec-websocket-version']` #### Query Parameters -Headers are exposed as an immutable multi-dict. +Query parameters are exposed as an immutable multi-dict. For example: `websocket.query_params['search']` From aee9106364cdca7c7da5b22fb06b9b7fc42d7cb2 Mon Sep 17 00:00:00 2001 From: Dan Trickey Date: Fri, 24 Jul 2020 11:13:14 +0100 Subject: [PATCH 2/2] Add type annotation to WebSocketEndpoint.encoding (#1003) * Add type annotation to WebSocketEndpoint.encoding * Update endpoints.py Co-authored-by: Florimond Manca --- starlette/endpoints.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/starlette/endpoints.py b/starlette/endpoints.py index 2ba68c04b1..1071fc3540 100644 --- a/starlette/endpoints.py +++ b/starlette/endpoints.py @@ -43,7 +43,7 @@ async def method_not_allowed(self, request: Request) -> Response: class WebSocketEndpoint: - encoding = None # May be "text", "bytes", or "json". + encoding: typing.Optional[str] = None # May be "text", "bytes", or "json". def __init__(self, scope: Scope, receive: Receive, send: Send) -> None: assert scope["type"] == "websocket"