From eedcd696a57521a18963d58487db8057a374a67a Mon Sep 17 00:00:00 2001 From: NAKAMURA Usaku Date: Thu, 30 Mar 2023 21:41:03 +0900 Subject: [PATCH] [ruby/net-http] Fix previous commit https://github.com/ruby/net-http/commit/1b276e2654 --- lib/net/http/header.rb | 4 ++-- 1 file 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