Class: RackFixContentType::Middleware

Inherits:
Object
  • Object
show all
Defined in:
lib/rack_fix_content_type/middleware.rb

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ Middleware

Returns a new instance of Middleware.



3
4
5
# File 'lib/rack_fix_content_type/middleware.rb', line 3

def initialize(app)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object



7
8
9
10
# File 'lib/rack_fix_content_type/middleware.rb', line 7

def call(env)
  fix_content_type(env["rack.request.form_hash"]) if env["rack.request.form_hash"]
  @app.call(env)
end