method
initialize_http_header

initialize_http_header(initheader)
public
Hide source
# File lib/net/http/header.rb, line 13 def initialize_http_header(initheader) @header = {} return unless initheader initheader.each do |key, value| warn "net/http: duplicated HTTP header: #{key}", uplevel: 1 if key?(key) and $VERBOSE if value.nil? warn "net/http: nil HTTP header: #{key}", uplevel: 1 if $VERBOSE else value = value.strip # raise error for invalid byte sequences if value.count("\r\n") > 0 raise ArgumentError, "header #{key} has field value #{value.inspect}, this cannot include CR/LF" end @header[key.downcase.to_s] = [value] end end end