Class: Rack::PactBroker::AddVaryHeader

Inherits:
Object
  • Object
show all
Defined in:
lib/rack/pact_broker/add_vary_header.rb

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ AddVaryHeader

Returns a new instance of AddVaryHeader.



29
30
31
# File 'lib/rack/pact_broker/add_vary_header.rb', line 29

def initialize app
  @app = app
end

Instance Method Details

#call(env) ⇒ Object



33
34
35
36
# File 'lib/rack/pact_broker/add_vary_header.rb', line 33

def call(env)
  status, headers, body = @app.call(env)
  [status, { "Vary" => "Accept" }.merge(headers || {}), body]
end