Show the caller's location

* lib/net/http/header.rb: show the caller's location instead of
  the current lines.
This commit is contained in:
Nobuyoshi Nakada 2019-07-24 00:24:12 +09:00
parent 325f7b6008
commit c9826c20d2
No known key found for this signature in database
GPG key ID: 4BC7D6DF58D8DF60
2 changed files with 15 additions and 3 deletions

View file

@ -14,9 +14,9 @@ module Net::HTTPHeader
@header = {}
return unless initheader
initheader.each do |key, value|
warn "net/http: duplicated HTTP header: #{key}", uplevel: 1 if key?(key) and $VERBOSE
warn "net/http: duplicated HTTP header: #{key}", uplevel: 3 if key?(key) and $VERBOSE
if value.nil?
warn "net/http: nil HTTP header: #{key}", uplevel: 1 if $VERBOSE
warn "net/http: nil HTTP header: #{key}", uplevel: 3 if $VERBOSE
else
value = value.strip # raise error for invalid byte sequences
if value.count("\r\n") > 0