From: nobu@... Date: 2016-02-13T02:07:57+00:00 Subject: [ruby-core:73787] [Ruby trunk Feature#8317] URI: no_proxy with whitespaces and leading dots. Issue #8317 has been updated by Nobuyoshi Nakada. Description updated Why also semicolon-separated? ```diff diff --git c/lib/uri/generic.rb w/lib/uri/generic.rb index aba54c1..f2a2d56 100644 --- c/lib/uri/generic.rb +++ w/lib/uri/generic.rb @@ -1546,7 +1546,7 @@ name = 'no_proxy' if no_proxy = ENV[name] || ENV[name.upcase] - no_proxy.scan(/([^:,]*)(?::(\d+))?/) {|host, port| + no_proxy.scan(/(?!\.)([^:,\s]+)(?::(\d+))?/) {|host, port| if /(\A|\.)#{Regexp.quote host}\z/i =~ self.host && (!port || self.port == port.to_i) return nil diff --git c/test/uri/test_generic.rb w/test/uri/test_generic.rb index b759657..70c3a73 100644 --- c/test/uri/test_generic.rb +++ w/test/uri/test_generic.rb @@ -831,6 +831,10 @@ assert_nil(URI("http://example.net/").find_proxy) assert_nil(URI("http://www.example.net/").find_proxy) } + with_env('http_proxy'=>'http://127.0.0.1:8080', 'no_proxy'=>'.example.net') { + assert_nil(URI("http://example.net/").find_proxy) + assert_nil(URI("http://www.example.net/").find_proxy) + } end def test_find_proxy_case_sensitive_env ``` ---------------------------------------- Feature #8317: URI: no_proxy with whitespaces and leading dots. https://bugs.ruby-lang.org/issues/8317#change-56966 * Author: Zachary Scott * Status: Assigned * Priority: Normal * Assignee: akira yamada ---------------------------------------- From [GitHub#285](https://github.com/ruby/ruby/pull/285) The previous implementation wouldn't allow for white-spaces nor a leading dot in the `no_proxy` list. 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. ---Files-------------------------------- 285.patch (1.22 KB) -- https://bugs.ruby-lang.org/ Unsubscribe: