Sha256: aba0b16bf1b57a9f1ce29cbac8aeff147bbc54d3d61bfa079b386a3e4fe7dab3
Contents?: true
Size: 513 Bytes
Versions: 31
Compression:
Stored size: 513 Bytes
Contents
module Rack # TODO: For some reason in Rack (or maybe thin), 304 headers close # the http connection. We might need to make this check if keep # alive was in the request. class KeepAlive def initialize(app) @app = app end def call(env) status, headers, body = @app.call(env) if status == 304 && env['HTTP_CONNECTION'] && env['HTTP_CONNECTION'].downcase == 'keep-alive' headers['Connection'] = 'keep-alive' end [status, headers, body] end end end
Version data entries
31 entries across 31 versions & 1 rubygems