lib/rambulance/exceptions_app.rb in rambulance-1.0.3 vs lib/rambulance/exceptions_app.rb in rambulance-1.1.0

- old
+ new

@@ -65,9 +65,15 @@ request.POST rescue ActionController::BadRequest request.env["MALFORMED_BODY"], request.env["rack.input"] = request.env["rack.input"], StringIO.new end + begin + request.accepts + rescue Mime::Type::InvalidMimeType + request.env["MALFORMED_HTTP_ACCEPT"], request.env["HTTP_ACCEPT"] = request.env["HTTP_ACCEPT"], "*/*" + end + # The #formats method needs to be called after the sanitization above. request.formats << Mime::Type.lookup('text/plain') super end