Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

LH#5277 Empty HTTP_ACCEPT header behaves like */*

  • Loading branch information...
commit 153ea94ada1895ae5ac89955c9aa6a9bd1f9eb17 1 parent bc556a2
@franckverrot authored
Showing with 7 additions and 3 deletions.
  1. +7 −3 actionpack/lib/action_dispatch/http/mime_negotiation.rb
View
10 actionpack/lib/action_dispatch/http/mime_negotiation.rb
@@ -22,10 +22,14 @@ def content_type
# Returns the accepted MIME type for the request.
def accepts
@env["action_dispatch.request.accepts"] ||= begin
- header = @env['HTTP_ACCEPT'].to_s.strip
+ header = @env['HTTP_ACCEPT']
- if header.empty?
- [content_mime_type]
+ if header.blank?
+ if xhr?
+ [content_mime_type]
+ else
+ ['*/*']# Mime::ALL
+ end
else
Mime::Type.parse(header)
end
Please sign in to comment.
Something went wrong with that request. Please try again.