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

Version Path
volt-0.9.7.pre8 lib/volt/server/rack/keep_alive.rb
volt-0.9.7.pre7 lib/volt/server/rack/keep_alive.rb
volt-0.9.7.pre6 lib/volt/server/rack/keep_alive.rb
volt-0.9.7.pre5 lib/volt/server/rack/keep_alive.rb
volt-0.9.7.pre3 lib/volt/server/rack/keep_alive.rb
volt-0.9.7.pre2 lib/volt/server/rack/keep_alive.rb
volt-0.9.6 lib/volt/server/rack/keep_alive.rb
volt-0.9.6.pre3 lib/volt/server/rack/keep_alive.rb
volt-0.9.6.pre2 lib/volt/server/rack/keep_alive.rb
volt-0.9.6.pre1 lib/volt/server/rack/keep_alive.rb
volt-0.9.5 lib/volt/server/rack/keep_alive.rb
volt-0.9.5.pre12 lib/volt/server/rack/keep_alive.rb
volt-0.9.5.pre11 lib/volt/server/rack/keep_alive.rb
volt-0.9.5.pre9 lib/volt/server/rack/keep_alive.rb
volt-0.9.5.pre8 lib/volt/server/rack/keep_alive.rb
volt-0.9.5.pre7 lib/volt/server/rack/keep_alive.rb
volt-0.9.5.pre6 lib/volt/server/rack/keep_alive.rb
volt-0.9.5.pre5 lib/volt/server/rack/keep_alive.rb
volt-0.9.5.pre4 lib/volt/server/rack/keep_alive.rb
volt-0.9.5.pre3 lib/volt/server/rack/keep_alive.rb