Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1c1b927af609
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: aa6cc1666630
Choose a head ref
  • 2 commits
  • 4 files changed
  • 1 contributor

Commits on Mar 2, 2016

  1. Copy the full SHA
    90da300 View commit details
  2. Copy the full SHA
    aa6cc16 View commit details
Showing with 22 additions and 13 deletions.
  1. +5 −8 lib/ruby/stdlib/net/http.rb
  2. +13 −3 lib/ruby/stdlib/uri/generic.rb
  3. +3 −2 test/mri.index
  4. +1 −0 test/mri/excludes/IMAPTest.rb
13 changes: 5 additions & 8 deletions lib/ruby/stdlib/net/http.rb
Original file line number Diff line number Diff line change
@@ -370,6 +370,7 @@ class HTTPHeaderSyntaxError < StandardError; end
# HTTPPreconditionRequired:: 428
# HTTPTooManyRequests:: 429
# HTTPRequestHeaderFieldsTooLarge:: 431
# HTTPUnavailableForLegalReasons:: 451
# HTTPServerError:: 5xx
# HTTPInternalServerError:: 500
# HTTPNotImplemented:: 501
@@ -609,9 +610,9 @@ class << HTTP
#
# In JRuby, this will default to the JSE proxy settings provided in the
# 'http.proxyHost' and 'http.proxyPort' Java system properties, if they
# are set and no alternative proxy has been provided.
# are set, falling back on environment variables otherwise.
#
def HTTP.new(address, port = nil, p_addr = ENV_JAVA['http.proxyHost'], p_port = ENV_JAVA['http.proxyPort'], p_user = nil, p_pass = nil)
def HTTP.new(address, port = nil, p_addr = :ENV, p_port = nil, p_user = nil, p_pass = nil)
http = super address, port

if proxy_class? then # from Net::HTTP::Proxy()
@@ -999,13 +1000,9 @@ def do_finish
#
# In JRuby, this will default to the JSE proxy settings provided in the
# 'http.proxyHost' and 'http.proxyPort' Java system properties, if they
# are set and no alternative proxy has been provided.
# are set, falling back on environment variables otherwise.
#
def HTTP.Proxy(p_addr = :ENV, p_port = ENV_JAVA['http.proxyHost'], p_user = ENV_JAVA['http.proxyPort'], p_pass = nil)
j_addr = ENV_JAVA['http.proxyHost']
j_port = ENV_JAVA['http.proxyPort']
p_addr = p_addr || j_addr
p_port = p_port || j_port
def HTTP.Proxy(p_addr = :ENV, p_port = nil, p_user = nil, p_pass = nil)
return self unless p_addr

Class.new(self) {
16 changes: 13 additions & 3 deletions lib/ruby/stdlib/uri/generic.rb
Original file line number Diff line number Diff line change
@@ -1522,9 +1522,19 @@ def find_proxy
proxy_uri = ENV["CGI_#{name.upcase}"]
end
elsif name == 'http_proxy'
unless proxy_uri = ENV[name]
if proxy_uri = ENV[name.upcase]
warn 'The environment variable HTTP_PROXY is discouraged. Use http_proxy.'
if p_addr = ENV_JAVA['http.proxyHost']
p_port = ENV_JAVA['http.proxyPort']
if p_user = ENV_JAVA['http.proxyUser']
p_pass = ENV_JAVA['http.proxyPass']
proxy_uri = "http://#{p_user}:#{p_pass}@#{p_addr}:#{p_port}"
else
proxy_uri = "http://#{p_addr}:#{p_port}"
end
else
unless proxy_uri = ENV[name]
if proxy_uri = ENV[name.upcase]
warn 'The environment variable HTTP_PROXY is discouraged. Use http_proxy.'
end
end
end
else
5 changes: 3 additions & 2 deletions test/mri.index
Original file line number Diff line number Diff line change
@@ -209,7 +209,9 @@ matrix/test_vector.rb

monitor/test_monitor.rb

net/ftp/test_buffered_socket.rb
net/ftp/test_ftp.rb
net/ftp/test_mlsx_entry.rb
net/http/test_buffered_io.rb
net/http/test_http.rb
net/http/test_http_request.rb
@@ -218,8 +220,7 @@ net/http/test_httpresponse.rb
net/http/test_httpresponses.rb
net/http/test_https.rb
net/http/test_https_proxy.rb
# hangs and mostly fails.rb
#net/imap/test_imap.rb
net/imap/test_imap.rb
net/imap/test_imap_response_parser.rb
net/pop/test_pop.rb
net/protocol/test_protocol.rb
1 change: 1 addition & 0 deletions test/mri/excludes/IMAPTest.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
exclude :test_imaps_post_connection_check, "Error: closed SSL engine"