Skip to content

Commit 9533812

Browse files
taketo1113sorah
andauthored
Update lib/net/http/generic_request.rb
Co-authored-by: Sorah Fukumori <sora134@gmail.com>
1 parent f9274a1 commit 9533812

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/net/http/generic_request.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def initialize(m, reqbody, resbody, uri_or_path, initheader = nil) # :nodoc:
2323
raise ArgumentError, "no host component for URI" unless (hostname && hostname.length > 0)
2424
@uri = uri_or_path.dup
2525
@host = @uri.host.dup
26-
@port = @uri.port if @uri.port != @uri.default_port
26+
@port = @uri.port == @uri.default_port ? nil : @uri.port
2727
@path = uri_or_path.request_uri
2828
raise ArgumentError, "no HTTP request path given" unless @path
2929
else

0 commit comments

Comments
 (0)