lib/async/http/protocol/http10.rb in async-http-0.9.0 vs lib/async/http/protocol/http10.rb in async-http-0.10.0
- old
+ new
@@ -33,11 +33,11 @@
def version
VERSION
end
def keep_alive?(headers)
- headers[HTTP_CONNECTION] == KEEP_ALIVE
+ headers[:connection] == KEEP_ALIVE
end
# Server loop.
def receive_requests
while request = Request.new(*self.read_request)
@@ -62,10 +62,10 @@
@stream.write("Content-Length: #{buffer.bytesize}\r\n\r\n")
@stream.write(buffer)
end
def read_body(headers)
- if content_length = headers[HTTP_CONTENT_LENGTH]
+ if content_length = headers[:content_length]
return @stream.read(Integer(content_length))
# elsif !keep_alive?(headers)
# return @stream.read
end
end