Module: ActionDispatch::Http::MimeNegotiation
- Defined in:
- lib/config/initializers/http_accept_patch.rb
Instance Method Summary collapse
-
#accepts ⇒ Object
Patched to always accept at least HTML rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/6022-content-negotiation-fails-for-some-headers-regression#ticket-6022-10.
Instance Method Details
#accepts ⇒ Object
Patched to always accept at least HTML rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/6022-content-negotiation-fails-for-some-headers-regression#ticket-6022-10
6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/config/initializers/http_accept_patch.rb', line 6 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 |