Skip to content

Commit

Permalink
Fix the regexp used to clean the host
Browse files Browse the repository at this point in the history
Introduced in ruby/ruby@c1652035644

`/s` marks the regexp as encoded with Windows-31J which makes little
sense.

Nurse thinks the intent was to use `/m` for a multi-line regexp.
  • Loading branch information
byroot committed Mar 18, 2021
1 parent e57d4f3 commit 6c15342
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/net/http/generic_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def update_uri(addr, port, ssl) # :nodoc: internal use only
end

if host = self['host']
host.sub!(/:.*/s, ''.freeze)
host.sub!(/:.*/m, ''.freeze)
elsif host = @uri.host
else
host = addr
Expand Down

0 comments on commit 6c15342

Please sign in to comment.