request.full_path property, closes #1184

This commit is contained in:
Simon Willison 2021-01-11 13:32:58 -08:00
commit 649f48cd70
3 changed files with 38 additions and 5 deletions

View file

@ -89,6 +89,14 @@ class Request:
def query_string(self):
return (self.scope.get("query_string") or b"").decode("latin-1")
@property
def full_path(self):
qs = self.query_string
return "{}{}".format(
self.path,
('?' + qs) if qs else ''
)
@property
def args(self):
return MultiParams(parse_qs(qs=self.query_string))