Skip to content

Commit 8fd3fdf

Browse files
authored
docs: document CSRF in JSON request body limitations (#10619)
* fix: preserve JSON body formatting when removing CSRF token * docs: document CSRF in JSON request body limitations
1 parent 9c62323 commit 8fd3fdf

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎user_guide_src/source/libraries/security.rst‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,13 @@ The order of checking the availability of the CSRF token is as follows:
224224

225225
.. note:: ``php://input`` (raw body) is checked since v4.4.2.
226226

227+
.. note::
228+
229+
If you include the CSRF token in a JSON object, removing it decodes and
230+
re-encodes the body. This changes its formatting and may affect number
231+
precision. To keep the JSON body unchanged, send the token in the
232+
``X-CSRF-TOKEN`` header and leave the CSRF field out of the body.
233+
227234
*********************
228235
Other Helpful Methods
229236
*********************

0 commit comments

Comments
 (0)