method
no_proxy?

v2_6_3 -
Show latest stable
-
0 notes -
Class: ConnectionPools
- 1_8_6_287
- 1_8_7_72
- 1_8_7_330
- 1_9_1_378
- 1_9_2_180
- 1_9_3_125
- 1_9_3_392
- 2_1_10
- 2_2_9 (0)
- 2_4_6 (0)
- 2_5_5 (0)
- 2_6_3 (0)
- What's this?
no_proxy?(host, env_no_proxy)
private
Hide source
# File lib/rubygems/request/connection_pools.rb, line 52 def no_proxy?(host, env_no_proxy) host = host.downcase env_no_proxy.any? do |pattern| env_no_proxy_pattern = pattern.downcase.dup # Remove dot in front of pattern for wildcard matching env_no_proxy_pattern[0] = "" if env_no_proxy_pattern[0] == "." host_tokens = host.split(".") pattern_tokens = env_no_proxy_pattern.split(".") intersection = (host_tokens - pattern_tokens) | (pattern_tokens - host_tokens) # When we do the split into tokens we miss a dot character, so add it back if we need it missing_dot = intersection.length > 0 ? 1 : 0 start = intersection.join(".").size + missing_dot no_proxy_host = host[start..-1] env_no_proxy_pattern == no_proxy_host end end