Class: FastlyRails::Rack::RemoveSetCookieHeader

Inherits:
Object
  • Object
show all
Defined in:
lib/fastly-rails/rack/remove_set_cookie_header.rb

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ RemoveSetCookieHeader

Returns a new instance of RemoveSetCookieHeader.



4
5
6
# File 'lib/fastly-rails/rack/remove_set_cookie_header.rb', line 4

def initialize(app)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object



8
9
10
11
12
13
14
15
16
# File 'lib/fastly-rails/rack/remove_set_cookie_header.rb', line 8

def call(env)
  status, headers, response = @app.call(env)

  if headers["Surrogate-Control"] || headers["Surrogate-Key"]
    headers.delete("Set-Cookie")
  end

  [status, headers, response]
end