Skip to content

Commit

Permalink
Patch Request.host in RSGI HTTP/2
Browse files Browse the repository at this point in the history
  • Loading branch information
gi0baro committed Jan 28, 2024
1 parent 7a3fec0 commit 6a409a1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions emmett/rsgi/wrappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ def __init__(
def headers(self):
return self._scope.headers

@cachedprop
def host(self) -> str:
if self._scope.http_version[0] == '1':
return self.headers.get('host')
return self._scope.authority

@cachedprop
def query_params(self) -> sdict[str, Union[str, List[str]]]:
rv: sdict[str, Any] = sdict()
Expand Down

0 comments on commit 6a409a1

Please sign in to comment.