Project

General

Profile

ActionsLike0

Bug #9385

closed

open-uri always uses proxy set as env var even if proxy flag is set to nil

Added by toch (Christophe Philemotte) about 11 years ago. Updated about 11 years ago.

Status:
Closed
Target version:
ruby -v:
2.0.0p247
[ruby-core:59650]

Description

According to doc http://ruby-doc.org/stdlib-2.1.0/libdoc/open-uri/rdoc/OpenURI.html we can disable the proxy by doing

open("http://www.ruby-lang.org/en/raa.html", :proxy => nil)

and "environment variables for proxy are ignored and connection will be made to a server directly". But it is not. The environment variable is still considered and used (cf attached script and logs).

After digging the code, I think it's because Net::HTTP.new is called without passing p_addr to nil. If I'm not wrong, the attached patch is a possible solution to fix it.


Files

run.sh (109 Bytes) run.sh reproducible script toch (Christophe Philemotte), 01/09/2014 06:49 AM
logs.txt (1.3 KB) logs.txt error output toch (Christophe Philemotte), 01/09/2014 06:49 AM
0001-open-uri-Ignore-ENV-for-proxy-when-proxy-flag-nil.patch (745 Bytes) 0001-open-uri-Ignore-ENV-for-proxy-when-proxy-flag-nil.patch possible solution toch (Christophe Philemotte), 01/09/2014 06:49 AM

Updated by akr (Akira Tanaka) about 11 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

Updated by nagachika (Tomoyuki Chikanaga) about 11 years ago

  • Backport changed from 1.9.3: UNKNOWN, 2.0.0: UNKNOWN, 2.1: UNKNOWN to 1.9.3: DONTNEED, 2.0.0: REQUIRED, 2.1: REQUIRED

Updated by nagachika (Tomoyuki Chikanaga) about 11 years ago

  • Backport changed from 1.9.3: DONTNEED, 2.0.0: REQUIRED, 2.1: REQUIRED to 1.9.3: DONTNEED, 2.0.0: DONE, 2.1: REQUIRED

Updated by naruse (Yui NARUSE) about 11 years ago

  • Backport changed from 1.9.3: DONTNEED, 2.0.0: DONE, 2.1: REQUIRED to 1.9.3: DONTNEED, 2.0.0: DONE, 2.1: DONE
ActionsLike0

Also available in: Atom PDF