aboutsummaryrefslogtreecommitdiffstats
path: root/lib/net
diff options
context:
space:
mode:
authorNAKAMURA Usaku <usa@ruby-lang.org>2023-03-30 21:41:03 +0900
committergit <svn-admin@ruby-lang.org>2023-03-31 03:22:41 +0000
commiteedcd696a57521a18963d58487db8057a374a67a (patch)
tree5276f88c9bdb1ad1197c6ee63066bf95e707c9ec /lib/net
parentd8b8294c28a09278de357c26b291abf1b9f3cc5d (diff)
downloadruby-eedcd696a57521a18963d58487db8057a374a67a.tar.gz
[ruby/net-http] Fix previous commit
https://github.com/ruby/net-http/commit/1b276e2654
Diffstat (limited to 'lib/net')
-rw-r--r--lib/net/http/header.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/net/http/header.rb b/lib/net/http/header.rb
index 324a9538b4..3bb57ff235 100644
--- a/lib/net/http/header.rb
+++ b/lib/net/http/header.rb
@@ -191,10 +191,10 @@ module Net::HTTPHeader
warn "net/http: nil HTTP header: #{key}", uplevel: 3 if $VERBOSE
else
value = value.strip # raise error for invalid byte sequences
- if key.bytesize > MAX_KEY_LENGTH
+ if key.to_s.bytesize > MAX_KEY_LENGTH
raise ArgumentError, "too long (#{key.bytesize} bytes) header: #{key[0, 30].inspect}..."
end
- if value.bytesize > MAX_FIELD_LENGTH
+ if value.to_s.bytesize > MAX_FIELD_LENGTH
raise ArgumentError, "header #{key} has too long field vallue: #{value.bytesize}"
end
if value.count("\r\n") > 0