diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-02-13 08:12:21 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-02-13 08:12:21 +0000 |
commit | 423d042371d0402071c309dc403ea2701600a98b (patch) | |
tree | e770b339bca127bb159ab39d977b732b5b55ea6a /test | |
parent | 1b6684f87868c74e9f14d1102c56a4a805a9f7ae (diff) |
no_proxy with whitespaces and leading dots
* lib/uri/generic.rb (find_proxy): exclude white-spaces and allow
for a leading dot in the domain name in no_proxy.
[ruby-core:54542] [Feature #8317]
The previous implementation wouldn't allow for white-spaces nor a leading dot
in the domain name. The latter is described in the wget documentation as a valid case.
By being more strict on the characters, which are counted to a domainname,
we allow for white-spaces.
Also, a possible leading dot will be handled gracefully.
[Fix GH-285]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53816 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/uri/test_generic.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/uri/test_generic.rb b/test/uri/test_generic.rb index fcfe1f9696..ad189fc13a 100644 --- a/test/uri/test_generic.rb +++ b/test/uri/test_generic.rb @@ -835,6 +835,10 @@ class URI::TestGeneric < Test::Unit::TestCase assert_nil(URI("http://example.org/").find_proxy) assert_nil(URI("http://www.example.org/").find_proxy) } + with_env('http_proxy'=>'http://127.0.0.1:8080', 'no_proxy'=>'.example.org') { + assert_nil(URI("http://example.org/").find_proxy) + assert_nil(URI("http://www.example.org/").find_proxy) + } end def test_find_proxy_bad_value |