ruby-changes:66003
From: Jean <ko1@a...>
Date: Wed, 28 Apr 2021 11:04:17 +0900 (JST)
Subject: [ruby-changes:66003] 1229ad0528 (master): [ruby/net-http] Fix the regexp used to clean the host
https://git.ruby-lang.org/ruby.git/commit/?id=1229ad0528 From 1229ad0528d28e38f031f1301e1c5331cfd03a90 Mon Sep 17 00:00:00 2001 From: Jean Boussier <jean.boussier@g...> Date: Thu, 18 Mar 2021 22:05:06 +0100 Subject: [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 --- lib/net/http/generic_request.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/net/http/generic_request.rb b/lib/net/http/generic_request.rb index 003f59d..0b81243 100644 --- a/lib/net/http/generic_request.rb +++ b/lib/net/http/generic_request.rb @@ -143,7 +143,7 @@ class Net::HTTPGenericRequest https://github.com/ruby/ruby/blob/trunk/lib/net/http/generic_request.rb#L143 end if host = self['host'] - host.sub!(/:.*/s, ''.freeze) + host.sub!(/:.*/m, ''.freeze) elsif host = @uri.host else host = addr -- cgit v1.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/