mirror of
https://github.com/bigskysoftware/htmx.git
synced 2025-09-30 22:41:23 +00:00
Documentation typo correction (#3182)
* Documentation update to include the use of hx-headers to prevent CSRF * Update hx-headers.md Revised follow review. * Update docs.md Typo correction
This commit is contained in:
parent
72b425f5fb
commit
0f9c4202ba
@ -1662,7 +1662,7 @@ for exploring this topic.
|
||||
|
||||
### CSRF Prevention
|
||||
|
||||
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 illustarted below.
|
||||
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.
|
||||
|
||||
```html
|
||||
<html lang="en" hx-headers='{"X-CSRF-TOKEN": "CSRF_TOKEN_INSERTED_HERE"}'>
|
||||
|
Loading…
x
Reference in New Issue
Block a user