Class: Rack::DontMessWithMyJs

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

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ DontMessWithMyJs

Returns a new instance of DontMessWithMyJs.



3
4
5
# File 'lib/rack/dont_mess_with_my_js.rb', line 3

def initialize(app)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/rack/dont_mess_with_my_js.rb', line 7

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

  headers['Cache-Control'] = ['no-transform', headers['Cache-Control']].compact.join(',')

  [status, headers, body]
end