Skip to content

Commit

Permalink
refactor: ignore type at assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
brussee committed Jan 10, 2023
1 parent aacd0bd commit e5b7b75
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 12 deletions.
4 changes: 1 addition & 3 deletions uvicorn/protocols/http/h11_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,10 +240,8 @@ def handle_events(self) -> None:
"raw_path": raw_path,
"query_string": query_string,
"headers": self.headers,
"extensions": {},
"extensions": {"tls": self.tls} if self.scheme == "https" else {},
}
if self.scheme == "https":
self.scope["extensions"]["tls"] = self.tls

upgrade = self._get_upgrade()
if upgrade == b"websocket" and self._should_upgrade_to_ws():
Expand Down
4 changes: 1 addition & 3 deletions uvicorn/protocols/http/httptools_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,10 +255,8 @@ def on_message_begin(self) -> None:
"scheme": self.scheme,
"root_path": self.root_path,
"headers": self.headers,
"extensions": {},
"extensions": {"tls": self.tls} if self.scheme == "https" else {},
}
if self.scheme == "https":
self.scope["extensions"]["tls"] = self.tls

# Parser callbacks
def on_url(self, url: bytes) -> None:
Expand Down
4 changes: 1 addition & 3 deletions uvicorn/protocols/websockets/websockets_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,8 @@ async def process_request(
"query_string": query_string.encode("ascii"),
"headers": asgi_headers,
"subprotocols": subprotocols,
"extensions": {},
"extensions": {"tls": self.tls} if self.scheme == "wss" else {},
}
if self.scheme == "wss":
self.scope["extensions"]["tls"] = self.tls
task = self.loop.create_task(self.run_asgi())
task.add_done_callback(self.on_task_complete)
self.tasks.add(task)
Expand Down
4 changes: 1 addition & 3 deletions uvicorn/protocols/websockets/wsproto_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,8 @@ def handle_connect(self, event: events.Request) -> None:
"query_string": query_string.encode("ascii"),
"headers": headers,
"subprotocols": event.subprotocols,
"extensions": {},
"extensions": {"tls": self.tls} if self.scheme == "wss" else {},
}
if self.scheme == "wss":
self.scope["extensions"]["tls"] = self.tls
self.queue.put_nowait({"type": "websocket.connect"})
task = self.loop.create_task(self.run_asgi())
task.add_done_callback(self.on_task_complete)
Expand Down

0 comments on commit e5b7b75

Please sign in to comment.