diff --git a/lib/grape/middleware/formatter.rb b/lib/grape/middleware/formatter.rb index 4de1af02e..2f96fd3b0 100644 --- a/lib/grape/middleware/formatter.rb +++ b/lib/grape/middleware/formatter.rb @@ -53,7 +53,7 @@ def build_formatted_response(status, headers, bodies) end def fetch_formatter(headers, options) - api_format = mime_types[headers[Rack::CONTENT_TYPE]] || env[Grape::Env::API_FORMAT] + api_format = env[Grape::Env::API_FORMAT] || mime_types[headers[Rack::CONTENT_TYPE]] Grape::Formatter.formatter_for(api_format, options[:formatters]) end