Skip to content

Conversation

christian-van-rensen-tng
Copy link
Contributor

@christian-van-rensen-tng christian-van-rensen-tng commented Jul 28, 2022

As discussed on this stackoverflow thread, the no_proxy environment variable defines a list of hosts, for which the proxy should be bypassed.
The same semantics should probably apply to the p_no_proxy parameter of Net::HTTP class.

At the moment, this method parameter seems to be misinterpreted as a list of proxies that should not be used.

This behaviour was not detected by the existing testcase, because both the destination hostname and the proxy hostname matched the given exclusion suffix.

It might seem surprising that this problem was not detected before, given the long history of the project.
However, the problem only occurs when the proxy is explicitly configured with `Net::HTTP.new(...)``, but not when using the environment variables.

* no_proxy is meant to operate on the destination address, not on the name of the proxy
* if both end with `'.example'`, the test does not nail down the behaviour
@christian-van-rensen-tng christian-van-rensen-tng marked this pull request as ready for review July 28, 2022 16:52
@hsbt hsbt merged commit b31db8d into ruby:master Oct 30, 2023
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.

2 participants