Skip to content

Commit

Permalink
Fix proxy CONNECT timeout (#506)
Browse files Browse the repository at this point in the history
* Fix proxy CONNECT timeout

* Update CHANGELOG
  • Loading branch information
tomchristie committed Feb 9, 2022
1 parent cad62bf commit b400d72
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
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

0 comments on commit b400d72

Please sign in to comment.