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
Родитель 4baf0757e4
Коммит d93dcd2840
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -20,7 +20,7 @@ module Net::HTTPHeader
else else
value = value.strip # raise error for invalid byte sequences value = value.strip # raise error for invalid byte sequences
if value.count("\r\n") > 0 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 end
@header[key.downcase] = [value] @header[key.downcase] = [value]
end end