зеркало из https://github.com/github/ruby.git
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:
Родитель
4baf0757e4
Коммит
d93dcd2840
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче