Skip to content

Commit b31db8d

Browse files
authored
Merge pull request #64 from christian-van-rensen-tng/master
Fix no_proxy behaviour
2 parents 97be4de + f4951dc commit b31db8d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/net/http.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1075,7 +1075,7 @@ def HTTP.new(address, port = nil, p_addr = :ENV, p_port = nil, p_user = nil, p_p
10751075
elsif p_addr == :ENV then
10761076
http.proxy_from_env = true
10771077
else
1078-
if p_addr && p_no_proxy && !URI::Generic.use_proxy?(p_addr, p_addr, p_port, p_no_proxy)
1078+
if p_addr && p_no_proxy && !URI::Generic.use_proxy?(address, address, port, p_no_proxy)
10791079
p_addr = nil
10801080
p_port = nil
10811081
end

test/net/http/test_http.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,10 @@ def test_proxy_address
126126

127127
def test_proxy_address_no_proxy
128128
TestNetHTTPUtils.clean_http_proxy_env do
129-
http = Net::HTTP.new 'hostname.example', nil, 'proxy.example', nil, nil, nil, 'example'
129+
http = Net::HTTP.new 'hostname.example', nil, 'proxy.com', nil, nil, nil, 'example'
130130
assert_nil http.proxy_address
131131

132-
http = Net::HTTP.new '10.224.1.1', nil, 'proxy.example', nil, nil, nil, 'example,10.224.0.0/22'
132+
http = Net::HTTP.new '10.224.1.1', nil, 'proxy.com', nil, nil, nil, 'example,10.224.0.0/22'
133133
assert_nil http.proxy_address
134134
end
135135
end

0 commit comments

Comments
 (0)