ruby-changes:73975
From: Hiroshi <ko1@a...>
Date: Thu, 13 Oct 2022 12:32:19 +0900 (JST)
Subject: [ruby-changes:73975] 1cda414622 (master): Raise ArgumentError with empty host url again.
https://git.ruby-lang.org/ruby.git/commit/?id=1cda414622 From 1cda4146224e857f6258241bbb30d9358ce2d6c7 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA <hsbt@r...> Date: Thu, 13 Oct 2022 11:41:43 +0900 Subject: Raise ArgumentError with empty host url again. Fixup dd5118f8524c425894d4716b787837ad7380bb0d Co-authored-by: Koichi Sasada <ko1@a...> --- lib/net/http/generic_request.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/net/http/generic_request.rb b/lib/net/http/generic_request.rb index 313de6ac92..d56835c76f 100644 --- a/lib/net/http/generic_request.rb +++ b/lib/net/http/generic_request.rb @@ -15,7 +15,8 @@ class Net::HTTPGenericRequest https://github.com/ruby/ruby/blob/trunk/lib/net/http/generic_request.rb#L15 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 -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/