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

uri/generic: Support comma-delimited rules in no_proxy #6424

Closed
wants to merge 1 commit into from

Conversation

stanhu
Copy link
Contributor

@stanhu stanhu commented Sep 23, 2022

Previously URI::Generic.use_proxy? did not treat the no_proxy variable as a comma-delimited string. That means that it's not possible to specify multiple rules, such as:

no_proxy=.example.com,192.168.0.0/8

While there's no official standard for no_proxy, the comma is parsed in other languages such as Python and Go.

https://bugs.ruby-lang.org/issues/19018

Previously `URI::Generic.use_proxy?` did not treat the `no_proxy`
variable as a comma-delimited string. That means that it's not
possible to specify multiple rules, such as:

```
no_proxy=.example.com,192.168.0.0/8
```

While there's no official standard for `no_proxy`, the comma is
parsed in other languages such as Python and Go.

https://bugs.ruby-lang.org/issues/19018
no_proxy.split(',').each do |name|
name.strip!

name.scan(/([^:,\s]+)(?::(\d+))?/) {|p_host, p_port|
Copy link
Contributor Author

@stanhu stanhu Sep 23, 2022

Choose a reason for hiding this comment

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

Hmm, what's this comma doing here? Oh, I see--it is trying to parse multiple hostnames here.

@esparta
Copy link
Contributor

esparta commented Sep 23, 2022

I think this should be sent to upstream: https://github.com/ruby/uri

@stanhu
Copy link
Contributor Author

stanhu commented Sep 23, 2022

I'm going to close this because it turns out this change is not needed. Maybe the test cases should be included, though.

@stanhu stanhu closed this Sep 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants