From ed231f652469189aafadea7c9d600d2a3a851a94 Mon Sep 17 00:00:00 2001 From: Darks Date: Wed, 7 Oct 2020 21:47:21 +0200 Subject: [PATCH] fix CSRF token for message preview (#77) --- app/templates/widgets/editor.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/templates/widgets/editor.html b/app/templates/widgets/editor.html index 7c641ad..c4dc0a4 100644 --- a/app/templates/widgets/editor.html +++ b/app/templates/widgets/editor.html @@ -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())