uvicorn 0.31.0__py3-none-any.whl → 0.31.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- uvicorn/__init__.py +1 -1
- uvicorn/config.py +1 -1
- uvicorn/main.py +1 -1
- uvicorn/middleware/proxy_headers.py +1 -1
- uvicorn/protocols/websockets/websockets_impl.py +4 -8
- {uvicorn-0.31.0.dist-info → uvicorn-0.31.1.dist-info}/METADATA +1 -1
- {uvicorn-0.31.0.dist-info → uvicorn-0.31.1.dist-info}/RECORD +10 -10
- {uvicorn-0.31.0.dist-info → uvicorn-0.31.1.dist-info}/WHEEL +0 -0
- {uvicorn-0.31.0.dist-info → uvicorn-0.31.1.dist-info}/entry_points.txt +0 -0
- {uvicorn-0.31.0.dist-info → uvicorn-0.31.1.dist-info}/licenses/LICENSE.md +0 -0
uvicorn/__init__.py
CHANGED
uvicorn/config.py
CHANGED
@@ -213,7 +213,7 @@ class Config:
|
|
213
213
|
timeout_notify: int = 30,
|
214
214
|
timeout_graceful_shutdown: int | None = None,
|
215
215
|
callback_notify: Callable[..., Awaitable[None]] | None = None,
|
216
|
-
ssl_keyfile: str | None = None,
|
216
|
+
ssl_keyfile: str | os.PathLike[str] | None = None,
|
217
217
|
ssl_certfile: str | os.PathLike[str] | None = None,
|
218
218
|
ssl_keyfile_password: str | None = None,
|
219
219
|
ssl_version: int = SSL_PROTOCOL_VERSION,
|
uvicorn/main.py
CHANGED
@@ -497,7 +497,7 @@ def run(
|
|
497
497
|
limit_max_requests: int | None = None,
|
498
498
|
timeout_keep_alive: int = 5,
|
499
499
|
timeout_graceful_shutdown: int | None = None,
|
500
|
-
ssl_keyfile: str | None = None,
|
500
|
+
ssl_keyfile: str | os.PathLike[str] | None = None,
|
501
501
|
ssl_certfile: str | os.PathLike[str] | None = None,
|
502
502
|
ssl_keyfile_password: str | None = None,
|
503
503
|
ssl_version: int = SSL_PROTOCOL_VERSION,
|
@@ -68,7 +68,7 @@ class _TrustedHosts:
|
|
68
68
|
"""Container for trusted hosts and networks"""
|
69
69
|
|
70
70
|
def __init__(self, trusted_hosts: list[str] | str) -> None:
|
71
|
-
self.always_trust: bool = trusted_hosts
|
71
|
+
self.always_trust: bool = trusted_hosts in ("*", ["*"])
|
72
72
|
|
73
73
|
self.trusted_literals: set[str] = set()
|
74
74
|
self.trusted_hosts: set[ipaddress.IPv4Address | ipaddress.IPv6Address] = set()
|
@@ -224,9 +224,7 @@ class WebSocketProtocol(WebSocketServerProtocol):
|
|
224
224
|
# itself (see https://github.com/encode/uvicorn/issues/920)
|
225
225
|
self.handshake_started_event.set()
|
226
226
|
|
227
|
-
async def ws_handler( # type: ignore[override]
|
228
|
-
self, protocol: WebSocketServerProtocol, path: str
|
229
|
-
) -> Any:
|
227
|
+
async def ws_handler(self, protocol: WebSocketServerProtocol, path: str) -> Any: # type: ignore[override]
|
230
228
|
"""
|
231
229
|
This is the main handler function for the 'websockets' implementation
|
232
230
|
to call into. We just wait for close then return, and instead allow
|
@@ -359,9 +357,7 @@ class WebSocketProtocol(WebSocketServerProtocol):
|
|
359
357
|
msg = "Unexpected ASGI message '%s', after sending 'websocket.close' " "or response already completed."
|
360
358
|
raise RuntimeError(msg % message_type)
|
361
359
|
|
362
|
-
async def asgi_receive(
|
363
|
-
self,
|
364
|
-
) -> WebSocketDisconnectEvent | WebSocketConnectEvent | WebSocketReceiveEvent:
|
360
|
+
async def asgi_receive(self) -> WebSocketDisconnectEvent | WebSocketConnectEvent | WebSocketReceiveEvent:
|
365
361
|
if not self.connect_sent:
|
366
362
|
self.connect_sent = True
|
367
363
|
return {"type": "websocket.connect"}
|
@@ -378,11 +374,11 @@ class WebSocketProtocol(WebSocketServerProtocol):
|
|
378
374
|
|
379
375
|
try:
|
380
376
|
data = await self.recv()
|
381
|
-
except ConnectionClosed
|
377
|
+
except ConnectionClosed:
|
382
378
|
self.closed_event.set()
|
383
379
|
if self.ws_server.closing:
|
384
380
|
return {"type": "websocket.disconnect", "code": 1012}
|
385
|
-
return {"type": "websocket.disconnect", "code":
|
381
|
+
return {"type": "websocket.disconnect", "code": self.close_code or 1005, "reason": self.close_reason}
|
386
382
|
|
387
383
|
if isinstance(data, str):
|
388
384
|
return {"type": "websocket.receive", "text": data}
|
@@ -1,11 +1,11 @@
|
|
1
|
-
uvicorn/__init__.py,sha256=
|
1
|
+
uvicorn/__init__.py,sha256=vv20frJB2RygWYa40Tn-_aITeQZqylK1YdgUn-z3Fwk,147
|
2
2
|
uvicorn/__main__.py,sha256=DQizy6nKP0ywhPpnCHgmRDYIMfcqZKVEzNIWQZjqtVQ,62
|
3
3
|
uvicorn/_subprocess.py,sha256=HbfRnsCkXyg7xCWVAWWzXQTeWlvLKfTlIF5wevFBkR4,2766
|
4
4
|
uvicorn/_types.py,sha256=TcUzCyKNq90ZX2Hxa6ce0juF558zLO_AyBB1XijnD2Y,7814
|
5
|
-
uvicorn/config.py,sha256=
|
5
|
+
uvicorn/config.py,sha256=gpsukzuJFbXBRN5_qOnLGiENmGgKM0Fi-eZJ6GwM1dQ,20849
|
6
6
|
uvicorn/importer.py,sha256=nRt0QQ3qpi264-n_mR0l55C2ddM8nowTNzT1jsWaam8,1128
|
7
7
|
uvicorn/logging.py,sha256=sg4D9lHaW_kKQj_kmP-bolbChjKfhBuihktlWp8RjSI,4236
|
8
|
-
uvicorn/main.py,sha256=
|
8
|
+
uvicorn/main.py,sha256=iv6ptgDBnko0W-VkHs0e3I4UrF7_5sEZrntQNKJGFNY,16915
|
9
9
|
uvicorn/py.typed,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
10
10
|
uvicorn/server.py,sha256=pIpMlW1WMWxarhM3wuZrffX0OcTEKoZXA82oY_M25d8,12879
|
11
11
|
uvicorn/workers.py,sha256=DukTKlrCyyvWVHbJWBJflIV2yUe-q6KaGdrEwLrNmyc,3893
|
@@ -19,7 +19,7 @@ uvicorn/loops/uvloop.py,sha256=K4QybYVxtK9C2emDhDPUCkBXR4XMT5Ofv9BPFPoX0ok,148
|
|
19
19
|
uvicorn/middleware/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
20
20
|
uvicorn/middleware/asgi2.py,sha256=YQrQNm3RehFts3mzk3k4yw8aD8Egtj0tRS3N45YkQa0,394
|
21
21
|
uvicorn/middleware/message_logger.py,sha256=IHEZUSnFNaMFUFdwtZO3AuFATnYcSor-gVtOjbCzt8M,2859
|
22
|
-
uvicorn/middleware/proxy_headers.py,sha256=
|
22
|
+
uvicorn/middleware/proxy_headers.py,sha256=f1VDAc-ipPHdNTuLNHwYCeDgYXoCL_VjD6hDTUXZT_U,5790
|
23
23
|
uvicorn/middleware/wsgi.py,sha256=TBeG4W_gEmWddbGfWyxdzJ0IDaWWkJZyF8eIp-1fv0U,7111
|
24
24
|
uvicorn/protocols/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
25
25
|
uvicorn/protocols/utils.py,sha256=rCjYLd4_uwPeZkbRXQ6beCfxyI_oYpvJCwz3jEGNOiE,1849
|
@@ -30,7 +30,7 @@ uvicorn/protocols/http/h11_impl.py,sha256=MuX72-pIyZGHDtZ75-1mveeTj6_ruL-306Ug7z
|
|
30
30
|
uvicorn/protocols/http/httptools_impl.py,sha256=TikbbIZRFG08KTClZER47ehM1Tu8koBfT6WGU5t5ACg,21491
|
31
31
|
uvicorn/protocols/websockets/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
32
32
|
uvicorn/protocols/websockets/auto.py,sha256=kNP-h07ZzjA9dKRUd7MNO0J7xhRJ5xVBfit7wCbdB0A,574
|
33
|
-
uvicorn/protocols/websockets/websockets_impl.py,sha256=
|
33
|
+
uvicorn/protocols/websockets/websockets_impl.py,sha256=LV58OW3whQAd4iwbJl4R3iIod8myVYK3IhAn6F5VeZ4,15490
|
34
34
|
uvicorn/protocols/websockets/wsproto_impl.py,sha256=haJEXK82Ldu8_hz4NDxQ0KpPXa9vOi6pG6iDLoBDKjs,15341
|
35
35
|
uvicorn/supervisors/__init__.py,sha256=UVJYW3RVHMDSgUytToyAgGyd9NUQVqbNpVrQrvm4Tpc,700
|
36
36
|
uvicorn/supervisors/basereload.py,sha256=Hxezjgt_HXkOPVj-hJGH7uj0bZ3EhmwsmaOBc63ySoM,3831
|
@@ -38,8 +38,8 @@ uvicorn/supervisors/multiprocess.py,sha256=Opt0XvOUj1DIMXYwb4OlkJZxeh_RjweFnTmDP
|
|
38
38
|
uvicorn/supervisors/statreload.py,sha256=gc-HUB44f811PvxD_ZIEQYenM7mWmhQQjYg7KKQ1c5o,1542
|
39
39
|
uvicorn/supervisors/watchfilesreload.py,sha256=41FGNMXPKrKvPr-5O8yRWg43l6OCBtapt39M-gpdk0E,3010
|
40
40
|
uvicorn/supervisors/watchgodreload.py,sha256=kd-gOvp14ArTNIc206Nt5CEjZZ4NP2UmMVYE7571yRQ,5486
|
41
|
-
uvicorn-0.31.
|
42
|
-
uvicorn-0.31.
|
43
|
-
uvicorn-0.31.
|
44
|
-
uvicorn-0.31.
|
45
|
-
uvicorn-0.31.
|
41
|
+
uvicorn-0.31.1.dist-info/METADATA,sha256=ClTG1r-p8xfowikO16LdWLojw-qLIdv4VC9UsPP0KjE,6569
|
42
|
+
uvicorn-0.31.1.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
|
43
|
+
uvicorn-0.31.1.dist-info/entry_points.txt,sha256=FW1w-hkc9QgwaGoovMvm0ZY73w_NcycWdGAUfDsNGxw,46
|
44
|
+
uvicorn-0.31.1.dist-info/licenses/LICENSE.md,sha256=7-Gs8-YvuZwoiw7HPlp3O3Jo70Mg_nV-qZQhTktjw3E,1526
|
45
|
+
uvicorn-0.31.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|