mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Raise ArgumentError with empty host url again.
Fixup dd5118f852
Co-authored-by: Koichi Sasada <ko1@atdot.net>
This commit is contained in:
parent
c50623f093
commit
1cda414622
Notes:
git
2022-10-13 12:32:25 +09:00
1 changed files with 2 additions and 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
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue