From 6c15342cdf14afd8b633a844c0939c2cdbed66be Mon Sep 17 00:00:00 2001 From: Jean Boussier Date: Thu, 18 Mar 2021 22:05:06 +0100 Subject: [PATCH] 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. --- 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 003f59d0..0b812430 100644 --- a/lib/net/http/generic_request.rb +++ b/lib/net/http/generic_request.rb @@ -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