diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-09-25 14:28:53 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-09-25 14:28:53 +0000 |
commit | 56f91c6ec52deb3808c426a6d53ac4616527e5ad (patch) | |
tree | 483be6cfb14a22595a6927251a614500a5b0294a /lib | |
parent | 0c482713dda3d8027b12c687b31a5fb5a9487786 (diff) | |
download | ruby-56f91c6ec52deb3808c426a6d53ac4616527e5ad.tar.gz |
HTTPHeader#add_field should allow binary [Bug #13926]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60021 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 |