Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Jul 16, 2013

Conversation

ampedandwired
Copy link
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