Skip to content

Commit

Permalink
[ruby/net-http] Fix the regexp used to clean the host
Browse files Browse the repository at this point in the history
Introduced in 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.

ruby/net-http@6c15342cdf
  • Loading branch information
byroot authored and hsbt committed Apr 28, 2021
1 parent 842f00f commit 1229ad0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/net/http/generic_request.rb
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 1229ad0

Please sign in to comment.