Sha256: abc0220b36c332c2aee3239fd372a64f70d0f4d36f7138dec0daac2ba1c5839e
Contents?: true
Size: 434 Bytes
Versions: 13
Compression:
Stored size: 434 Bytes
Contents
class Rack::App::Middlewares::HeaderSetter def initialize(app, headers) @app = app @headers = headers.freeze end def call(env) response = rack_response(@app.call(env)) @headers.each do |header, value| response.headers[header] ||= value end response.finish end protected def rack_response(raw_response) Rack::Response.new(raw_response[2], raw_response[0], raw_response[1]) end end
Version data entries
13 entries across 13 versions & 1 rubygems