fix CSRF token for message preview (#77)

This commit is contained in:
Darks 2020-10-07 21:47:21 +02:00
parent 227087ebbc
commit ed231f6524
Signed by untrusted user: Darks
GPG Key ID: 7515644268BE1433
1 changed files with 4 additions and 1 deletions

View File

@ -24,7 +24,10 @@
data = {text: plainText};
fetch('{{ url_for("api_markdown") }}', {
method: "POST",
headers: { 'Content-Type': 'application/json' },
headers: {
'Content-Type': 'application/json',
'X-CSRFToken': '{{ csrf_token() }}'
},
body: JSON.stringify(data)
})
.then(response => response.text())