diff options
Diffstat (limited to 'src/hydrilla/proxy/http_messages.py')
-rw-r--r-- | src/hydrilla/proxy/http_messages.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/hydrilla/proxy/http_messages.py b/src/hydrilla/proxy/http_messages.py index 698020d..53d10db 100644 --- a/src/hydrilla/proxy/http_messages.py +++ b/src/hydrilla/proxy/http_messages.py @@ -44,7 +44,7 @@ else: from .. import url_patterns -DefaultGetValue = t.TypeVar('DefaultGetValue', object, None) +DefaultGetValue = t.TypeVar('DefaultGetValue', str, None) class IHeaders(Protocol): """....""" @@ -52,8 +52,13 @@ class IHeaders(Protocol): def get_all(self, key: str) -> t.Iterable[str]: ... - def get(self, key: str, default: DefaultGetValue = None) \ - -> t.Union[str, DefaultGetValue]: ... + @t.overload + def get(self, key: str) -> t.Optional[str]: + ... + @t.overload + def get(self, key: str, default: DefaultGetValue) \ + -> t.Union[str, DefaultGetValue]: + ... def items(self) -> t.Iterable[tuple[str, str]]: ... @@ -99,6 +104,7 @@ class ProducedResponse: class ResponseInfo: """....""" url: url_patterns.ParsedUrl + orig_url: url_patterns.ParsedUrl status_code: int headers: IHeaders body: bytes |