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

Allow keep-alive with proxy for message with appropriate header #5764

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions CHANGES/5765.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Allow keep-alive connection with proxy when client explicitly sets keep-alive header.
5 changes: 3 additions & 2 deletions aiohttp/connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -1286,8 +1286,9 @@

# Many HTTP proxies has buggy keepalive support. Let's not
# reuse connection but close it after processing every
# response.
proto.force_close()
# response besides request has keep-alive header.
if not req.keep_alive():
proto.force_close()

Check warning on line 1291 in aiohttp/connector.py

View check run for this annotation

Codecov / codecov/patch

aiohttp/connector.py#L1291

Added line #L1291 was not covered by tests

auth = proxy_req.headers.pop(hdrs.AUTHORIZATION, None)
if auth is not None:
Expand Down
Loading