Skip to content

Commit 8caf622

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

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
@@ -246,7 +246,7 @@ def update_uri(addr, port, ssl) # :nodoc: internal use only
246246
end
247247

248248
if host = self['host']
249-
host = URI.parse("#{scheme}://#{host}").host
249+
host = URI.parse("//#{host}").host # Remove a port component from the existing Host header
250250
elsif host = @uri.host
251251
else
252252
host = addr

0 commit comments

Comments
 (0)