Module: Firehose::Rack::Helpers

Included in:
Consumer::HttpLongPoll::Handler, Ping::PingCheck, Publisher
Defined in:
lib/firehose/rack.rb

Instance Method Summary collapse

Instance Method Details

#response(status, body = '', headers = {}) ⇒ Object

Calculates the content of a message body for the response so that HTTP Keep-Alive connections work.



26
27
28
29
# File 'lib/firehose/rack.rb', line 26

def response(status, body='', headers={})
  headers = {'Content-Length' => body.size.to_s}.merge(headers)
  [status, headers, [body]]
end