mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
request.url_vars property, closes #822
This commit is contained in:
parent
db660db463
commit
fac8e93815
5 changed files with 28 additions and 4 deletions
|
|
@ -32,6 +32,10 @@ class Request:
|
|||
(self.scheme, self.host, self.path, None, self.query_string, None)
|
||||
)
|
||||
|
||||
@property
|
||||
def url_vars(self):
|
||||
return (self.scope.get("url_route") or {}).get("kwargs") or {}
|
||||
|
||||
@property
|
||||
def scheme(self):
|
||||
return self.scope.get("scheme") or "http"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue