File tree 2 files changed +21
-15
lines changed
2 files changed +21
-15
lines changed Original file line number Diff line number Diff line change @@ -168,21 +168,9 @@ from your application and returning them to the client.
168
168
169
169
.. caution ::
170
170
171
- By default, a kernel based on the cache ignores the ``framework.http_method_override ``
172
- option, which could lead to errors when using ``PUT ``, ``DELETE `` and ``PURGE ``
173
- methods in HTTP requests.
174
-
175
- Invoke the ``enableHttpMethodParameterOverride() `` method before creating the
176
- ``Request `` object in order to take this option into account::
177
-
178
- // web/app.php
179
-
180
- // ...
181
- $kernel = new AppCache($kernel);
182
-
183
- Request::enableHttpMethodParameterOverride(); // <-- add this line
184
- $request = Request::createFromGlobals();
185
- // ...
171
+ If you're using the :ref: `framework.http_method_override <configuration-framework-http_method_override >`
172
+ option to read the HTTP method from a ``_method `` parameter, see the
173
+ above link for a tweak you need to make.
186
174
187
175
.. tip ::
188
176
Original file line number Diff line number Diff line change @@ -82,6 +82,24 @@ method gets called automatically. It becomes the service container parameter
82
82
named ``kernel.http_method_override ``. For more information, see
83
83
:doc: `/cookbook/routing/method_parameters `.
84
84
85
+ .. caution ::
86
+
87
+ If you're using the :ref: `AppCache Reverse Proxy <symfony2-reverse-proxy >`
88
+ with this option, the kernel will ignore the ``_method `` parameter,
89
+ which could lead to errors.
90
+
91
+ To fix this, invoke the ``enableHttpMethodParameterOverride() `` method
92
+ before creating the ``Request `` object::
93
+
94
+ // web/app.php
95
+
96
+ // ...
97
+ $kernel = new AppCache($kernel);
98
+
99
+ Request::enableHttpMethodParameterOverride(); // <-- add this line
100
+ $request = Request::createFromGlobals();
101
+ // ...
102
+
85
103
ide
86
104
~~~
87
105
You can’t perform that action at this time.
0 commit comments