summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiroshi SHIBATA <[email protected]>2022-10-13 11:41:43 +0900
committerHiroshi SHIBATA <[email protected]>2022-10-13 12:32:02 +0900
commit1cda4146224e857f6258241bbb30d9358ce2d6c7 ()
treefcf333fdee0fc594cdb61924abd0f5109f0b8bcc
parentc50623f0934ec0b94550fa59a2b0ffcb1b0f858f (diff)
Raise ArgumentError with empty host url again.
Fixup dd5118f8524c425894d4716b787837ad7380bb0d Co-authored-by: Koichi Sasada <[email protected]>
Notes: Merged: https://.com/ruby/ruby/pull/6538
-rw-r--r--lib/net/http/generic_request.rb3
1 files changed, 2 insertions, 1 deletions
@@ -15,7 +15,8 @@ class Net::HTTPGenericRequest
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
@uri = uri_or_path.dup
host = @uri.hostname.dup
host << ":".freeze << @uri.port.to_s if @uri.port != @uri.default_port