File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -93,6 +93,17 @@ You can pass an custom exception lambda to the ```force_format_filter``` method
93
93
force_format_filter :for => :html, :exception => lambda { |msg| raise(MyApp::AwesomeException.new(msg)) }
94
94
end
95
95
96
+
97
+ #### Widcard accept header
98
+
99
+ If an user agent sets the accept header wildcard like ``` */* ``` ``` force_format_filter ``` would fallback
100
+ and set the ``` request.format ``` to * : html * . This is important for access via ``` curl ``` and I think for the
101
+ google bot too. If you don't want this behaviour of wildcard rewriting you can set the ``` :skip_wildcard ``` option.
102
+
103
+ class PagesController < ApplicationController
104
+ force_format_filter :for => :html, :skip_wildcard => true
105
+ end
106
+
96
107
NOTE: Call the method ``` force_format_filter ``` only once per controller!
97
108
If you call it multiple times, the last one would be used.
98
109
You can’t perform that action at this time.
0 commit comments