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']` 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"