Skip to content

Do not pass proxy options to Net::HTTP connection if not specified - #222

Merged
jnunemaker merged 1 commit into
jnunemaker:masterfrom
ampedandwired:ruby2-proxy-0.11.0
Jul 16, 2013
Merged

Do not pass proxy options to Net::HTTP connection if not specified#222
jnunemaker merged 1 commit into
jnunemaker:masterfrom
ampedandwired:ruby2-proxy-0.11.0

Conversation

@ampedandwired

Copy link
Copy Markdown
Contributor

Ruby 2.0 has changed the Net::HTTP.new method so that if you don't specify
a proxy address it defaults to using the proxy specified by the http_proxy
environment variable (if set). Passing nil for the proxy address now means
that a proxy is never used even if the http_proxy environment variable is
set.

However HTTParty was always passing the proxy option values even if they
were nil, which meant that the defaulting to http_proxy environment variable
didn't work.

With this change the proxy values are only passed if http_proxyaddr is non-nil.

See issue #184 for further details.

Ruby 2.0 has changed the Net::HTTP.new method so that if you don't specify
a proxy address it defaults to using the proxy specified by the http_proxy
environment variable (if set). Passing nil for the proxy address now means
that a proxy is never used even if the http_proxy environment variable is
set.

However HTTParty was always passing the proxy option values even if they
were nil, which meant that the defaulting to http_proxy environment variable
didn't work.

With this change the proxy values are only passed if http_proxyaddr is non-nil.
jnunemaker pushed a commit that referenced this pull request Jul 16, 2013
Do not pass proxy options to Net::HTTP connection if not specified
@jnunemaker
jnunemaker merged commit f7b84a9 into jnunemaker:master Jul 16, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants