You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit fac07a7
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: docs/aiohttp.rst
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -284,7 +284,7 @@ When establishing an HTTPS connection through a proxy, the connector:
284
284
* Creates a CONNECT request to the proxy server
285
285
* Includes any custom proxy headers you've specified
286
286
* Captures the proxy's response headers (e.g., ``X-ProxyMesh-IP``)
287
-
* Stores them so they can be merged into the final response
287
+
* Stores them so safe CONNECT values can be merged into the final response without overwriting origin headers. Hop-by-hop and security-sensitive names are omitted. The full CONNECT set is on ``response.proxy_headers``.
288
288
289
289
You typically don't need to use this class directly - it's automatically configured when using ``ProxyClientSession``.
Copy file name to clipboardExpand all lines: docs/httpx.rst
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -375,7 +375,7 @@ The extension classes work by intercepting the CONNECT request/response cycle du
375
375
376
376
2. **CONNECT Response**: The proxy responds with a CONNECT response (status 200) that may include proxy information headers in the response (e.g., ``X-ProxyMesh-IP: 192.168.1.1``)
377
377
378
-
3. **Header Merging**: These proxy response headers are captured during the tunnel establishment and stored. When the actual HTTP request is made through the tunnel, the proxy response headers are merged into the final HTTP response headers using ``merge_headers()``
378
+
3. **Header Merging**: Safe CONNECT headers are stored and later merged into the origin response with ``merge_headers()``. Origin headers are never overwritten, and hop-by-hop or security-sensitive names such as ``Set-Cookie`` or ``Location`` from CONNECT are not copied.
379
379
380
380
4. **Access**: Your application can then access both the target server's response headers and the proxy's response headers from the same response object
Copy file name to clipboardExpand all lines: docs/requests.rst
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,6 +46,8 @@ This section shows you how to quickly get up and running with proxy headers in r
46
46
47
47
That's it! The ``requests_adapter`` module handles sending your custom headers to the proxy and makes proxy response headers available in the response.
48
48
49
+
CONNECT response headers are copied onto ``response.headers`` except hop-by-hop and security-sensitive names (``Set-Cookie``, ``Location``, ``Content-Type``, and similar). Existing origin headers are never overwritten. The full CONNECT set is on ``response.proxy_headers``.
Copy file name to clipboardExpand all lines: docs/urllib3.rst
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,6 +45,8 @@ This section shows you how to quickly get up and running with proxy headers in u
45
45
46
46
That's it! The ``ProxyHeaderManager`` handles sending your custom headers to the proxy and makes proxy response headers available in the response.
47
47
48
+
CONNECT response headers are copied onto ``response.headers`` except hop-by-hop and security-sensitive names (``Set-Cookie``, ``Location``, ``Content-Type``, and similar). Existing origin headers are never overwritten. The full CONNECT set is on ``response.proxy_headers``.
0 commit comments