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

Adding host details in proxy headers #6866

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

HarikrishnanTechie
Copy link

@HarikrishnanTechie HarikrishnanTechie commented Jan 3, 2025

Issue:
The connect request does not include host details when operating in a proxy environment. This can lead to failures in establishing a proper connection, as the host information is essential for routing the request through the proxy.

Code Explanation:
To address this issue, the following approach is used:

Check for Host in Proxy Settings:
If the proxy_kwargs dictionary contains a host key, it indicates that host details are available.

Add Host to Proxy Headers:
These host details are added to the proxy_headers dictionary under the Host key. By doing so, the host information is explicitly included in the proxy headers, ensuring that the connect request incorporates the correct routing details.

Impact:
Including the host details in the proxy_headers ensures that the connect request is properly formed and able to route through the proxy environment without any missing information. This resolves the issue and enhances connectivity reliability

@sigmavirus24
Copy link
Contributor

We should resolve urllib3/urllib3#3532 first. Both of these PRs lack tests and the correct way to handle the header in question

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants