Skip to content

Commit

Permalink
reduce indent
Browse files Browse the repository at this point in the history
  • Loading branch information
bdraco committed Oct 1, 2024
1 parent 86a2e23 commit 45e104a
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions aiohttp/client_reqrep.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,15 +380,17 @@ def update_headers(self, headers: Optional[LooseHeaders]) -> None:
self.headers[hdrs.HOST] = host

if headers:
if isinstance(headers, (dict, MultiDictProxy, MultiDict)):
headers = headers.items()
return

for key, value in headers: # type: ignore[misc]
# A special case for Host header
if key.lower() == "host":
self.headers[key] = value
else:
self.headers.add(key, value)
if isinstance(headers, (dict, MultiDictProxy, MultiDict)):
headers = headers.items()

for key, value in headers: # type: ignore[misc]
# A special case for Host header
if key.lower() == "host":
self.headers[key] = value
else:
self.headers.add(key, value)

def update_auto_headers(self, skip_auto_headers: Optional[Iterable[str]]) -> None:
if skip_auto_headers is not None:
Expand Down

0 comments on commit 45e104a

Please sign in to comment.