1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Add comment to BROWSER_LIKE_ACCEPTS [ci skip]

The concept of treating Accept header lists including "*/*" as
identifying the request as coming from a browser, and allowing the mime
negotiation to fall back to a HTML response, was introduced in commits
1310231c15 and dc5300adb6.

I am adding the comment (based on the commit messages of the two commits
mentioned) because it is far from obvious why this regex exists and what
it does.

Co-authored-by: Matthew Riddle <mriddle89@gmail.com>
This commit is contained in:
Benjamin Quorning 2019-11-18 14:49:54 +01:00
parent f2df77709f
commit 39e3a75e93

View file

@ -152,6 +152,8 @@ module ActionDispatch
end
private
# We use normal content negotiation unless you include */* in your list,
# in which case we assume you're a browser and send HTML.
BROWSER_LIKE_ACCEPTS = /,\s*\*\/\*|\*\/\*\s*,/
def params_readable? # :doc: