lib/grape/middleware/base.rb in grape-0.6.1 vs lib/grape/middleware/base.rb in grape-0.7.0

- old
+ new

@@ -25,18 +25,17 @@ after || @app_response end # @abstract # Called before the application is called in the middleware lifecycle. - def before; end + def before + end + # @abstract # Called after the application is called in the middleware lifecycle. # @return [Response, nil] a Rack SPEC response or nil to call the application afterwards. - def after; end - - def request - Grape::Request.new(env) + def after end def response Rack::Response.new(@app_response) end @@ -52,11 +51,12 @@ def content_type content_type_for(env['api.format'] || options[:format]) || 'text/html' end def mime_types - content_types.invert + content_types.each_with_object({}) { |(k, v), types_without_params| + types_without_params[k] = v.split(';').first + }.invert end - end end end