diff options
author | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-12-20 15:59:14 +0000 |
---|---|---|
committer | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-12-20 15:59:14 +0000 |
commit | d2b5c16e1955b0f7887b15a505f5848669ae2935 (patch) | |
tree | eef4704e51647ede9e76bfb9b5fb376bf2804012 /lib | |
parent | 888f1f24e90dc3bd2c196e39dc8469ec703b0572 (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_4@61373 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 4777ebf82a..8f3206d363 100644 --- a/lib/net/http/header.rb +++ b/lib/net/http/header.rb @@ -76,7 +76,7 @@ module Net::HTTPHeader @header[key.downcase] = ary else val = val.to_s - if /[\r\n]/.match?(val) + if /[\r\n]/n.match?(val.b) raise ArgumentError, 'header field value cannnot include CR/LF' end @header[key.downcase] = [val] @@ -89,7 +89,7 @@ module Net::HTTPHeader val.each{|x| append_field_value(ary, x)} else val = val.to_s - if /[\r\n]/.match?(val) + if /[\r\n]/n.match?(val.b) raise ArgumentError, 'header field value cannnot include CR/LF' end ary.push val |