aboutsummaryrefslogtreecommitdiffstats
path: root/test/uri
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-05-17 07:40:01 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-05-17 07:40:01 +0000
commitd50ecb63ec02043865a4217af7e738f22ea6e8c7 (patch)
tree392ef62399657b972e91dd4f8d50494454b8a29f /test/uri
parent5a1dfb04bc2b09fcf8f3427cac72d0ce52a45eb2 (diff)
downloadruby-d50ecb63ec02043865a4217af7e738f22ea6e8c7.tar.gz
http_proxy setting should respect both parent domain and subdomain
URI::Generic: Respect no_proxy for both parent domain and subdomains It is now possible to add just the subdomains for proxy bypass. In a setting where the main domain needs to go through proxy while the subdomains don't, it is now possible to just add the subdomains to the no_proxy list. The assumption that subdomains and the parent domain should behave the same wrt no_proxy has been removed. eg: Adding .example.com in no_proxy would allow example.com to go through the proxy. From: Harsimran Singh Maan <maan.harry@gmail.com> fix https://github.com/ruby/ruby/pull/1748 [Bug #14345] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63452 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/uri')
-rw-r--r--test/uri/test_generic.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/test/uri/test_generic.rb b/test/uri/test_generic.rb
index 31aa5c7552..c850eb02d1 100644
--- a/test/uri/test_generic.rb
+++ b/test/uri/test_generic.rb
@@ -898,7 +898,7 @@ class URI::TestGeneric < Test::Unit::TestCase
assert_nil(URI("http://www.example.org/").find_proxy(env))
}
with_proxy_env('http_proxy'=>'http://127.0.0.1:8080', 'no_proxy'=>'.example.org') {|env|
- assert_nil(URI("http://example.org/").find_proxy(env))
+ assert_equal(URI('http://127.0.0.1:8080'), URI("http://example.org/").find_proxy(env))
assert_nil(URI("http://www.example.org/").find_proxy(env))
}
end
@@ -940,7 +940,13 @@ class URI::TestGeneric < Test::Unit::TestCase
['example.com', nil, 80, 'example.com:80', false],
['example.com', nil, 80, 'example.org,example.com:80,example.net', false],
['foo.example.com', nil, 80, 'example.com', false],
+ ['foo.example.com', nil, 80, '.example.com', false],
+ ['example.com', nil, 80, '.example.com', true],
+ ['xample.com', nil, 80, '.example.com', true],
+ ['fooexample.com', nil, 80, '.example.com', true],
['foo.example.com', nil, 80, 'example.com:80', false],
+ ['foo.eXample.com', nil, 80, 'example.com:80', false],
+ ['foo.example.com', nil, 80, 'eXample.com:80', false],
['foo.example.com', nil, 80, 'example.com:443', true],
['127.0.0.1', '127.0.0.1', 80, '10.224.0.0/22', true],
['10.224.1.1', '10.224.1.1', 80, '10.224.1.1', false],