Skip to content

Commit

Permalink
Raise ArgumentError with empty host url again.
Browse files Browse the repository at this point in the history
  Fixup ruby/ruby@dd5118f

ruby/ruby@1cda414

Co-authored-by: Koichi Sasada <ko1@atdot.net>
  • Loading branch information
2 people authored and nobu committed Oct 13, 2022
1 parent 3b8471d commit d03283d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/net/http/generic_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ def initialize(m, reqbody, resbody, uri_or_path, initheader = nil)

if URI === uri_or_path then
raise ArgumentError, "not an HTTP URI" unless URI::HTTP === uri_or_path
raise ArgumentError, "no host component for URI" unless uri_or_path.hostname
hostname = uri_or_path.hostname
raise ArgumentError, "no host component for URI" unless (hostname && hostname.length > 0)
@uri = uri_or_path.dup
host = @uri.hostname.dup
host << ":".freeze << @uri.port.to_s if @uri.port != @uri.default_port
Expand Down

0 comments on commit d03283d

Please sign in to comment.