You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Recommend using a form with a hidden input or an adjacent CSRF token in
the header. Stop recommending a global token in the `html` or `body`
tags as those may not work with `hx-boost`.
Fix#3379
Copy file name to clipboardExpand all lines: www/content/docs.md
+24-8Lines changed: 24 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1695,22 +1695,38 @@ for exploring this topic.
1695
1695
1696
1696
### CSRF Prevention
1697
1697
1698
-
The assignment and checking of CSRF tokens are typically backend responsibilities, but `htmx` can support returning the CSRF token automatically with every request using the `hx-headers` attribute. The attribute needs to be added to the element issuing the request or one of its ancestor elements. This makes the `html` and `body` elements effective global vehicles for adding the CSRF token to the `HTTP` request header, as illustrated below.
1698
+
The assignment and checking of CSRF tokens are typically backend responsibilities.
1699
+
For example, using Django, a popular Python web framework
0 commit comments