Project

General

Profile

Actions

Bug #13063

closed

net/http abends with local file URI

Added by hedgehog (Hedge Hog) over 7 years ago. Updated over 4 years ago.

Status:
Rejected
Assignee:
-
Target version:
-
ruby -v:
ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux]
[ruby-core:78809]

Description

Give the ruby code in issue.rb is:

begin

  require 'uri'
  require 'net/http'
  p ::File.exist?('/tmp/tomcat-8/v8.0.39/bin/apache-tomcat-8.0.39.tar.gz.md5')
  uri = URI( 'file:/tmp/tomcat-8/v8.0.39/bin/apache-tomcat-8.0.39.tar.gz.md5' )
  req= Net::HTTP.new(uri.host, uri.port)
  req.get( uri )
rescue => e
  p e.inspect
  p e.backtrace
end

Then the results is

true
"#<TypeError: can't dup NilClass>"
["/opt/chef/embedded/lib/ruby/2.3.0/net/http/generic_request.rb:18:in `dup'", "/opt/chef/embedded/lib/ruby/2.3.0/net/http/generic_request.rb:18:in `initialize'", "/opt/chef/embedded/lib/ruby/2.3.0/net/http/request.rb:15:in `initialize'", "/opt/chef/embedded/lib/ruby/2.3.0/net/http.rb:1156:in `new'", "/opt/chef/embedded/lib/ruby/2.3.0/net/http.rb:1156:in `get'", "/tmp/issue.rb:7:in `<main>'"]

Updated by hedgehog (Hedge Hog) over 7 years ago

  • Description updated (diff)

Updated by shyouhei (Shyouhei Urabe) over 7 years ago

  • Status changed from Open to Feedback

Sorry, I don't get what you want. Net::HTTP is a HTTP library and file:/// is not a HTTP URL. You are doing something that never works.

Maybe you want a higher level abstraction? If so I think that should be done in a separate library than Net::HTTP.

Updated by shevegen (Robert A. Heiler) over 7 years ago

Reports like the above are not very good because the reporter has not really explained his point.

Actions #4

Updated by jeremyevans0 (Jeremy Evans) over 4 years ago

  • Status changed from Feedback to Rejected
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0