kopia lustrzana https://github.com/simonw/datasette
asgi: check raw_path is not None (#719)
The ASGI spec (https://asgi.readthedocs.io/en/latest/specs/www.html#http) seems to imply that `None` is a valid value, so we need to check the value itself, not just whether the key is present. In particular, the [mangum](https://github.com/erm/mangum) adapter passes `None` for this key.pull/763/head
rodzic
c91fb9e3d4
commit
dbd2d70b38
|
@ -46,7 +46,7 @@ class Request:
|
|||
|
||||
@property
|
||||
def path(self):
|
||||
if "raw_path" in self.scope:
|
||||
if self.scope.get("raw_path") is not None:
|
||||
return self.scope["raw_path"].decode("latin-1")
|
||||
else:
|
||||
path = self.scope["path"]
|
||||
|
|
Ładowanie…
Reference in New Issue