Integração Pangolin Proxy
This commit is contained in:
@@ -255,13 +255,19 @@ class HTTPHeaderDict(typing.MutableMapping[str, str]):
|
||||
self._container[key.lower()] = [key, val]
|
||||
|
||||
def __getitem__(self, key: str) -> str:
|
||||
if isinstance(key, bytes):
|
||||
key = key.decode("latin-1")
|
||||
val = self._container[key.lower()]
|
||||
return ", ".join(val[1:])
|
||||
|
||||
def __delitem__(self, key: str) -> None:
|
||||
if isinstance(key, bytes):
|
||||
key = key.decode("latin-1")
|
||||
del self._container[key.lower()]
|
||||
|
||||
def __contains__(self, key: object) -> bool:
|
||||
if isinstance(key, bytes):
|
||||
key = key.decode("latin-1")
|
||||
if isinstance(key, str):
|
||||
return key.lower() in self._container
|
||||
return False
|
||||
@@ -376,6 +382,8 @@ class HTTPHeaderDict(typing.MutableMapping[str, str]):
|
||||
) -> list[str] | _DT:
|
||||
"""Returns a list of all the values for the named field. Returns an
|
||||
empty list if the key doesn't exist."""
|
||||
if isinstance(key, bytes):
|
||||
key = key.decode("latin-1")
|
||||
try:
|
||||
vals = self._container[key.lower()]
|
||||
except KeyError:
|
||||
|
||||
Reference in New Issue
Block a user