Fix plus test for unicode characters in custom query name, closes #558

This commit is contained in:
Simon Willison 2019-07-13 19:49:24 -07:00
commit 90d4f497f9
3 changed files with 25 additions and 16 deletions

View file

@ -45,9 +45,10 @@ class Request:
@property
def path(self):
return (
self.scope.get("raw_path", self.scope["path"].encode("latin-1"))
).decode("latin-1")
if "raw_path" in self.scope:
return self.scope["raw_path"].decode("latin-1")
else:
return self.scope["path"].decode("utf-8")
@property
def query_string(self):