1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[ruby/net-http] Fix the regexp used to clean the host

Introduced in https://github.com/ruby/ruby/commit/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.

https://github.com/ruby/net-http/commit/6c15342cdf
This commit is contained in:
Jean Boussier 2021-03-18 22:05:06 +01:00 committed by Hiroshi SHIBATA
parent 842f00f452
commit 1229ad0528

View file

@ -143,7 +143,7 @@ class Net::HTTPGenericRequest
end
if host = self['host']
host.sub!(/:.*/s, ''.freeze)
host.sub!(/:.*/m, ''.freeze)
elsif host = @uri.host
else
host = addr