Skip to content

Commit

Permalink
[PR #9386/803d818d backport][3.10] Small speed up to starting client …
Browse files Browse the repository at this point in the history
…requests (#9388)

Co-authored-by: J. Nick Koston <nick@koston.org>
  • Loading branch information
patchback[bot] and bdraco authored Oct 1, 2024
1 parent 8e395a1 commit 456cf5e
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 @@ -308,7 +308,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.compress = compress
Expand Down Expand Up @@ -611,7 +611,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 @@ -862,7 +865,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 456cf5e

Please sign in to comment.