Implement request body and normalized headers access

This commit is contained in:
Loic Nageleisen 2017-09-19 15:35:55 +02:00
parent dc8739c692
commit dd5001cb7c

View file

@ -102,6 +102,14 @@ module NanoServe
Hash[*@uri.query.split('&').map { |kv| kv.split('=') }.flatten]
end
def body
@body
end
def [](key)
@headers[key.downcase]
end
def <<(line)
if @method.nil?
parse_request(line.chomp)