Sha256: 2350bd7155e17dc59c43bd67bbe3ea45299bd891c2a294b17c57169ded82647f
Contents?: true
Size: 569 Bytes
Versions: 19
Compression:
Stored size: 569 Bytes
Contents
module Rack # Allows you to tap into the response headers. Yields a Rack::Utils::HeaderHash # of current response headers to the block. Example: # # use Rack::ResponseHeaders do |headers| # headers['X-Foo'] = 'bar' # headers.delete('X-Baz') # end # class ResponseHeaders def initialize(app, &block) @app = app @block = block end def call(env) response = @app.call(env) headers = Utils::HeaderHash.new(response[1]) @block.call(headers) response[1] = headers response end end end
Version data entries
19 entries across 19 versions & 2 rubygems