summaryrefslogtreecommitdiff
path: root/lib/uri
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-02-13 08:12:21 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-02-13 08:12:21 +0000
commit423d042371d0402071c309dc403ea2701600a98b (patch)
treee770b339bca127bb159ab39d977b732b5b55ea6a /lib/uri
parent1b6684f87868c74e9f14d1102c56a4a805a9f7ae (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 'lib/uri')
-rw-r--r--lib/uri/generic.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/uri/generic.rb b/lib/uri/generic.rb
index aba54c14b6..f2a2d567e3 100644
--- a/lib/uri/generic.rb
+++ b/lib/uri/generic.rb
@@ -1546,7 +1546,7 @@ module URI
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