| 1 |
<!DOCTYPE html> |
| 2 |
<html lang="en"> |
| 3 |
<head> |
| 4 |
<meta charset="UTF-8"> |
| 5 |
<title>Gorilla CSRF</title> |
| 6 |
<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script> |
| 7 |
</head> |
| 8 |
<body> |
| 9 |
<div> |
| 10 |
<h1>Gorilla CSRF: Axios JS Frontend</h1> |
| 11 |
<p>See Console and Network tabs of your browser's Developer Tools for further details</p> |
| 12 |
</div> |
| 13 |
|
| 14 |
<div> |
| 15 |
<h2>Get Request:</h2> |
| 16 |
<h3>Full Response:</h3> |
| 17 |
<code id="get-request-full-response"></code> |
| 18 |
<h3>CSRF Token:</h3> |
| 19 |
<code id="get-response-csrf-token"></code> |
| 20 |
</div> |
| 21 |
|
| 22 |
|
| 23 |
<div> |
| 24 |
<h2>Post Request:</h2> |
| 25 |
<h3>Full Response:</h3> |
| 26 |
<p> |
| 27 |
Note that the <code>X-CSRF-Token</code> value is in the Axios <code>config.headers</code>; |
| 28 |
it is not a response header set by the server. |
| 29 |
</p> |
| 30 |
<code id="post-request-full-response"></code> |
| 31 |
</div> |
| 32 |
</body> |
| 33 |
<script src="index.js"></script> |
| 34 |
</html> |