Module: HTTP::Header

Defined in:
lib/http_validator.rb

Class Method Summary collapse

Class Method Details

.parse(str) ⇒ Object



17
18
19
20
21
22
23
24
# File 'lib/http_validator.rb', line 17

def self.parse(str)
  headers = {}
  str.gsub(/\r/, '').split(/\n/).each { |i|
    k, v = i.split(': ')
    headers[k] = v
  }
  headers
end