From 1ee3306761607db89520e7127b85b2761d149fe9 Mon Sep 17 00:00:00 2001
From: Paul Brussee
Date: Tue, 10 Jan 2023 21:33:03 +0100
Subject: [PATCH] type: ignore type at assignment
---
uvicorn/protocols/http/h11_impl.py | 2 +-
uvicorn/protocols/http/httptools_impl.py | 2 +-
uvicorn/protocols/websockets/websockets_impl.py | 3 ++-
uvicorn/protocols/websockets/wsproto_impl.py | 3 ++-
4 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/uvicorn/protocols/http/h11_impl.py b/uvicorn/protocols/http/h11_impl.py
index a2e0f61893..cf60cb7a62 100644
--- a/uvicorn/protocols/http/h11_impl.py
+++ b/uvicorn/protocols/http/h11_impl.py
@@ -243,7 +243,7 @@ def handle_events(self) -> None:
"extensions": {},
}
if self.scheme == "https":
- self.scope["extensions"]["tls"] = self.tls
+ self.scope["extensions"]["tls"] = self.tls # type: ignore
upgrade = self._get_upgrade()
if upgrade == b"websocket" and self._should_upgrade_to_ws():
diff --git a/uvicorn/protocols/http/httptools_impl.py b/uvicorn/protocols/http/httptools_impl.py
index b85d81afb0..bc545ab920 100644
--- a/uvicorn/protocols/http/httptools_impl.py
+++ b/uvicorn/protocols/http/httptools_impl.py
@@ -258,7 +258,7 @@ def on_message_begin(self) -> None:
"extensions": {},
}
if self.scheme == "https":
- self.scope["extensions"]["tls"] = self.tls
+ self.scope["extensions"]["tls"] = self.tls # type: ignore
# Parser callbacks
def on_url(self, url: bytes) -> None:
diff --git a/uvicorn/protocols/websockets/websockets_impl.py b/uvicorn/protocols/websockets/websockets_impl.py
index 1335733cd4..36e1f02ee5 100644
--- a/uvicorn/protocols/websockets/websockets_impl.py
+++ b/uvicorn/protocols/websockets/websockets_impl.py
@@ -211,7 +211,8 @@ async def process_request(
"extensions": {},
}
if self.scheme == "wss":
- self.scope["extensions"]["tls"] = self.tls
+ self.scope["extensions"]["tls"] = self.tls # type: ignore
+
task = self.loop.create_task(self.run_asgi())
task.add_done_callback(self.on_task_complete)
self.tasks.add(task)
diff --git a/uvicorn/protocols/websockets/wsproto_impl.py b/uvicorn/protocols/websockets/wsproto_impl.py
index ed13b0c9cf..a373509afa 100644
--- a/uvicorn/protocols/websockets/wsproto_impl.py
+++ b/uvicorn/protocols/websockets/wsproto_impl.py
@@ -194,7 +194,8 @@ def handle_connect(self, event: events.Request) -> None:
"extensions": {},
}
if self.scheme == "wss":
- self.scope["extensions"]["tls"] = self.tls
+ self.scope["extensions"]["tls"] = self.tls # type: ignore
+
self.queue.put_nowait({"type": "websocket.connect"})
task = self.loop.create_task(self.run_asgi())
task.add_done_callback(self.on_task_complete)