open-uri broken when fetching from ftp over proxy
Commit 24a52978d4e2fe59cfa57c216c1118dce5f81640 by akr broke open-uri when fetching from ftp:// servers over a proxy (ftp_proxy environment variable). Undoing that commit fixes the issue.
Updated by jeremyevans0 (Jeremy Evans) 9 days ago
- Status changed from Open to Closed
Looking at the mentioned commit, I'm not sure how it is possible that the commit broke it. The only code change is:
- http = klass.new(target_host, target_port) + http = proxy ? klass.new(target_host, target_port) : klass.new(target_host, target_port, nil)
proxy is always set if the request for ftp through http proxy. I tried a simple test setting the
ftp_proxy environment variable:
$ ftp_proxy=http://proxy_addr ruby -ropen-uri -e "p open('ftp://target')"
And it does make a request to
GET ftp://target HTTP/1.1. So it certainly appears to be working. I also tried ruby 2.1.9 and got the same results.