Skip to content

Commit

Permalink
Small speed up to starting client requests (#9386)
Browse files Browse the repository at this point in the history
  • Loading branch information
bdraco authored Oct 1, 2024
1 parent 8a583ed commit 803d818
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions aiohttp/client_reqrep.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def __init__(
if params:
url = url.extend_query(params)
self.original_url = url
self.url = url.with_fragment(None)
self.url = url.with_fragment(None) if url.raw_fragment else url
self.method = method.upper()
self.chunked = chunked
self.loop = loop
Expand Down Expand Up @@ -539,7 +539,10 @@ def update_body_from_data(self, body: Any) -> None:
def update_expect_continue(self, expect: bool = False) -> None:
if expect:
self.headers[hdrs.EXPECT] = "100-continue"
elif self.headers.get(hdrs.EXPECT, "").lower() == "100-continue":
elif (
hdrs.EXPECT in self.headers
and self.headers[hdrs.EXPECT].lower() == "100-continue"
):
expect = True

if expect:
Expand Down Expand Up @@ -790,7 +793,7 @@ def __init__(
self.cookies = SimpleCookie()

self._real_url = url
self._url = url.with_fragment(None)
self._url = url.with_fragment(None) if url.raw_fragment else url
self._body: Optional[bytes] = None
self._writer = writer
self._continue = continue100 # None by default
Expand Down

0 comments on commit 803d818

Please sign in to comment.