From ecb7182f93594109970db1811057c35ca71f73b2 Mon Sep 17 00:00:00 2001 From: usa Date: Wed, 31 Jan 2018 11:47:49 +0000 Subject: merge revision(s) 60021: [Backport #13926] HTTPHeader#add_field should allow binary [Bug #13926] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@62133 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/net/http/header.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/net/http/header.rb b/lib/net/http/header.rb index 7eee15e361..50580658d0 100644 --- a/lib/net/http/header.rb +++ b/lib/net/http/header.rb @@ -72,7 +72,7 @@ module Net::HTTPHeader @header[key.downcase] = ary else val = val.to_s - if /[\r\n]/ =~ val + if /[\r\n]/n =~ val.b raise ArgumentError, 'header field value cannnot include CR/LF' end @header[key.downcase] = [val] @@ -85,7 +85,7 @@ module Net::HTTPHeader val.each{|x| append_field_value(ary, x)} else val = val.to_s - if /[\r\n]/ =~ val + if /[\r\n]/n =~ val.b raise ArgumentError, 'header field value cannnot include CR/LF' end ary.push val -- cgit v1.2.3