class Patron::Response

def parse_headers(header_data)

Called by the C code to parse and set the headers
def parse_headers(header_data)
  @headers = {}
  lines = header_data.split("\r\n")
  @status_line = lines.shift
  lines.each do |line|
    break if line.empty?
    hdr, val = line.split(":", 2)
    val.strip! unless val.nil?
    if @headers.key?(hdr)
      @headers[hdr] = [@headers[hdr]] unless @headers[hdr].kind_of? Array
      @headers[hdr] << val
    else
      @headers[hdr] = val
    end
  end
end