Module: ActionDispatch::Http::MimeNegotiation

Defined in:
lib/config/initializers/http_accept_patch.rb

Instance Method Summary collapse

Instance Method Details

#acceptsObject



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