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 NO_PROXY settings #3117

Merged
merged 2 commits into from
Apr 17, 2023
Merged

Conversation

gergokee
Copy link
Contributor

Description
When using the proxy => no request option guzzle fails to ignore the proxy if ENV vars are present on the server i.e. http_proxy or https_proxy.

This is because the no option only applies the CURLOPT_PROXY if the host is not in the list. So when ignoring it doesn't apply the curl option so falling back to the proxy that is set in the ENV var.

Fixes: #3093

Disable proxies set by ENV vars if found in NO_PROXY settings.
Fixes: guzzle#3093
Copy link
Member

@GrahamCampbell GrahamCampbell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tests are failing here, indicating that this behaviour was possibly intentional? If not, can you update the tests and add new tests please?

@gergokee
Copy link
Contributor Author

gergokee commented Apr 14, 2023

The tests are failing here, indicating that this behaviour was possibly intentional? If not, can you update the tests and add new tests please?

Fixed, added unset() instead of setting to empty value. Test are succeeding now.

@GrahamCampbell GrahamCampbell changed the title Fix NO_PROXY settings Fix NO_PROXY settings Apr 17, 2023
@GrahamCampbell GrahamCampbell merged commit c6f3a35 into guzzle:master Apr 17, 2023
23 of 24 checks passed
@GrahamCampbell
Copy link
Member

Thanks for working on this. 👍

@GrahamCampbell
Copy link
Member

7.5.1 released, including this fix. 🎉

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

Successfully merging this pull request may close these issues.

The no proxy request option does not override proxies set in ENV vars
3 participants