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
Colin Dellow 2020-05-04 13:14:25 -04:00 zatwierdzone przez GitHub
rodzic c91fb9e3d4
commit dbd2d70b38
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -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"]