diff --git a/config/initializers/mime_type_fix.rb b/config/initializers/mime_type_fix.rb new file mode 100644 index 0000000..ef42b0e --- /dev/null +++ b/config/initializers/mime_type_fix.rb @@ -0,0 +1,21 @@ +module ActionDispatch + module Http + module MimeNegotiation + + # Patched to always accept at least HTML + def accepts + @env["action_dispatch.request.accepts"] ||= begin + header = @env['HTTP_ACCEPT'].to_s.strip + + if header.empty? + [content_mime_type] + else + Mime::Type.parse(header) << Mime::HTML + end + end + end + + end + end +end +