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: warning: duplicated HTTP header: #{key}" if key?(key) and $VERBOSE if value.nil? warn "net/http: warning: nil HTTP header: #{key}" if $VERBOSE else value = value.strip # raise error for invalid byte sequences if value.count("\r\n") > 0 raise ArgumentError, 'header field value cannot include CR/LF' end @header[key.downcase] = [value] end end end