Skip to content

Commit 1b276e2

Browse files
unakhsbt
authored andcommitted
Fix previous commit
1 parent c245f7f commit 1b276e2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/net/http/header.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,10 +191,10 @@ def initialize_http_header(initheader) #:nodoc:
191191
warn "net/http: nil HTTP header: #{key}", uplevel: 3 if $VERBOSE
192192
else
193193
value = value.strip # raise error for invalid byte sequences
194-
if key.bytesize > MAX_KEY_LENGTH
194+
if key.to_s.bytesize > MAX_KEY_LENGTH
195195
raise ArgumentError, "too long (#{key.bytesize} bytes) header: #{key[0, 30].inspect}..."
196196
end
197-
if value.bytesize > MAX_FIELD_LENGTH
197+
if value.to_s.bytesize > MAX_FIELD_LENGTH
198198
raise ArgumentError, "header #{key} has too long field vallue: #{value.bytesize}"
199199
end
200200
if value.count("\r\n") > 0

0 commit comments

Comments
 (0)