Skip to content

Commit

Permalink
Fixed issue #1292 - Don't use Proxy on localhost Addresses.
Browse files Browse the repository at this point in the history
  • Loading branch information
martini committed Jul 27, 2017
1 parent d8be2e0 commit 5568d59
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/user_agent.rb
Expand Up @@ -264,7 +264,10 @@ def self.request(url, options = {})
def self.get_http(uri, options)

proxy = options['proxy'] || Setting.get('proxy')
if proxy.present?
proxy_no = options['proxy_no'] || Setting.get('proxy_no') || ''
proxy_no = proxy_no.split(',').map(&:strip) || []
proxy_no.push('localhost', '127.0.0.1', '::1')
if proxy.present? && !proxy_no.include?(uri.host.downcase)
if proxy =~ /^(.+?):(.+?)$/
proxy_host = $1
proxy_port = $2
Expand Down

0 comments on commit 5568d59

Please sign in to comment.