summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean Boussier <jean.boussier@gmail.com>2021-03-18 22:05:06 +0100
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2021-04-28 11:01:41 +0900
commit1229ad0528d28e38f031f1301e1c5331cfd03a90 (patch)
tree1d251bdc26bd875e7b6cfd8cbf254d74c3291c20
parent842f00f45212019a3b07f8d8dac269d35beb9efa (diff)
[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
-rw-r--r--lib/net/http/generic_request.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/net/http/generic_request.rb b/lib/net/http/generic_request.rb
index 003f59d0ac..0b81243064 100644
--- a/lib/net/http/generic_request.rb
+++ b/lib/net/http/generic_request.rb
@@ -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