Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PR #9386/803d818d backport][3.10] Small speed up to starting client requests #9388

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading