diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-01-31 11:47:49 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-01-31 11:47:49 +0000 |
commit | ecb7182f93594109970db1811057c35ca71f73b2 (patch) | |
tree | f737466f823ac5aaa538107a615bb35248235d37 /lib | |
parent | 66dfa32fe052cc2a7e8155954706381dd52c02e1 (diff) |
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
Diffstat (limited to 'lib')
-rw-r--r-- | lib/net/http/header.rb | 4 |
1 files changed, 2 insertions, 2 deletions
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 |