File tree Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change 4
4
5
5
* Add :recursive option to javascript_include_tag and stylesheet_link_tag to be used along with :all. #480 [Damian Janowski]
6
6
7
- * Disable the Accept header by default [Michael Koziarski]
7
+ * Allow users to disable the use of the Accept header [Michael Koziarski]
8
8
9
9
The accept header is poorly implemented by browsers and causes strange
10
10
errors when used on public sites where crawlers make requests too. You
11
- should use formatted urls (e.g. /people/1.xml) to support API clients.
11
+ can use formatted urls (e.g. /people/1.xml) to support API clients in a
12
+ much simpler way.
12
13
13
- Alternatively to re-enable it you need to set:
14
+ To disable the header you need to set:
14
15
15
- config.action_controller.use_accept_header = true
16
+ config.action_controller.use_accept_header = false
16
17
17
18
* Do not stat template files in production mode before rendering. You will no longer be able to modify templates in production mode without restarting the server [Josh Peek]
18
19
Original file line number Diff line number Diff line change @@ -343,12 +343,12 @@ class Base
343
343
# Indicates whether the response format should be determined by examining the Accept HTTP header,
344
344
# or by using the simpler params + ajax rules.
345
345
#
346
- # If this is set to +true+ then +respond_to+ and +Request#format+ will take the Accept header into
347
- # account. If it is set to false (the default) then the request format will be determined solely
346
+ # If this is set to +true+ (the default) then +respond_to+ and +Request#format+ will take the Accept
347
+ # header into account. If it is set to false then the request format will be determined solely
348
348
# by examining params[:format]. If params format is missing, the format will be either HTML or
349
349
# Javascript depending on whether the request is an AJAX request.
350
350
cattr_accessor :use_accept_header
351
- self . use_accept_header = false
351
+ self . use_accept_header = true
352
352
353
353
# Controls whether request forgergy protection is turned on or not. Turned off by default only in test mode.
354
354
class_inheritable_accessor :allow_forgery_protection
You can’t perform that action at this time.
0 commit comments