fix unknown mime type errors

This commit is contained in:
Lee Lawlor 2014-05-22 14:48:53 -04:00
parent a581e272ac
commit 2991c723eb

View File

@ -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