1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

net/http: Improve net/http header error message.

Patch by Matt Larraz. [Fix GH-1849].

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
marcandre 2018-09-19 17:12:04 +00:00
parent 4baf0757e4
commit d93dcd2840

View file

@ -20,7 +20,7 @@ module Net::HTTPHeader
else
value = value.strip # raise error for invalid byte sequences
if value.count("\r\n") > 0
raise ArgumentError, 'header field value cannot include CR/LF'
raise ArgumentError, "header #{key} has field value #{value.inspect}, this cannot include CR/LF"
end
@header[key.downcase] = [value]
end