summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-02-13 08:31:12 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-02-13 08:31:12 +0000
commit1ee9cad027e910b36bd4191ef2339d02e6711a32 (patch)
treefe8f994ee21b1d14a394208c6d9c23a292b7f687 /test
parent423d042371d0402071c309dc403ea2701600a98b (diff)
CIDR in no_proxy
* lib/uri/generic.rb (URI::Generic#find_proxy): support CIDR in no_proxy. [ruby-core:73769] [Feature#12062] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53817 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/uri/test_generic.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/uri/test_generic.rb b/test/uri/test_generic.rb
index ad189fc13a..3510129832 100644
--- a/test/uri/test_generic.rb
+++ b/test/uri/test_generic.rb
@@ -841,6 +841,14 @@ class URI::TestGeneric < Test::Unit::TestCase
}
end
+ def test_find_proxy_no_proxy_cidr
+ with_env('http_proxy'=>'http://127.0.0.1:8080', 'no_proxy'=>'192.0.2.0/24') {
+ assert_equal(URI('http://127.0.0.1:8080'), URI("http://192.0.1.1/").find_proxy)
+ assert_nil(URI("http://192.0.2.1/").find_proxy)
+ assert_nil(URI("http://192.0.2.2/").find_proxy)
+ }
+ end
+
def test_find_proxy_bad_value
with_env('http_proxy'=>'') {
assert_nil(URI("http://192.0.2.1/").find_proxy)