initialize_http_header(initheader) public

No documentation

This method has no description. You can help the Ruby community by adding new notes.

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
Register or log in to add new notes.