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

Fix proxy CONNECT timeout #506

Merged
merged 2 commits into from Feb 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## Master branch

- Ensure HTTP proxy CONNECT requests include `timeout` configuration. (#506)

## 0.14.7 (February 4th, 2022)

- Requests which raise a PoolTimeout need to be removed from the pool queue. (#502)
Expand Down
5 changes: 4 additions & 1 deletion httpcore/_async/http_proxy.py
Expand Up @@ -250,7 +250,10 @@ async def handle_async_request(self, request: Request) -> Response:
[(b"Host", target), (b"Accept", b"*/*")], self._proxy_headers
)
connect_request = Request(
method=b"CONNECT", url=connect_url, headers=connect_headers
method=b"CONNECT",
url=connect_url,
headers=connect_headers,
extensions=request.extensions,
)
connect_response = await self._connection.handle_async_request(
connect_request
Expand Down
5 changes: 4 additions & 1 deletion httpcore/_sync/http_proxy.py
Expand Up @@ -250,7 +250,10 @@ def handle_request(self, request: Request) -> Response:
[(b"Host", target), (b"Accept", b"*/*")], self._proxy_headers
)
connect_request = Request(
method=b"CONNECT", url=connect_url, headers=connect_headers
method=b"CONNECT",
url=connect_url,
headers=connect_headers,
extensions=request.extensions,
)
connect_response = self._connection.handle_request(
connect_request
Expand Down