Skip to content

Commit 40bf456

Browse files
committed
minor #7640 Removed any reference to X-Status-Code (javiereguiluz)
This PR was merged into the 2.7 branch. Discussion ---------- Removed any reference to X-Status-Code Fabien says that end users should NEVER use X-Status-Code (see symfony/symfony#22019), so let's remove any reference to it in the docs ... and let's not document the new way to do it (see http://symfony.com/blog/new-in-symfony-3-3-deprecated-x-status-code). Commits ------- 18f8437 Removed any reference to X-Status-Code
2 parents fe9ec52 + 18f8437 commit 40bf456

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

reference/events.rst

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -241,19 +241,8 @@ and set a new ``Exception`` object, or do nothing::
241241

242242
.. note::
243243

244-
If you want to overwrite the status code (which you should do not without a good
245-
reason), set the ``X-Status-Code`` header::
246-
247-
$response = new Response(
248-
'Error',
249-
404, // this status code will be ignored
250-
array(
251-
'X-Status-Code' => 200 // this status code will actually be sent to the client
252-
)
253-
);
254-
255-
If you do **not** set the ``X-Status-Code`` header, then Symfony uses the following
256-
logic to determine the status code:
244+
Symfony uses the following logic to determine the HTTP status code of the
245+
response:
257246

258247
* If :method:`Symfony\\Component\\HttpFoundation\\Response::isClientError`,
259248
:method:`Symfony\\Component\\HttpFoundation\\Response::isServerError` or

0 commit comments

Comments
 (0)