diff --git a/emmett/rsgi/wrappers.py b/emmett/rsgi/wrappers.py index e6a189b6..0de63011 100644 --- a/emmett/rsgi/wrappers.py +++ b/emmett/rsgi/wrappers.py @@ -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()