From 159638084e167047b86fd65382f50cd099d4eb48 Mon Sep 17 00:00:00 2001 From: Brian Picciano Date: Tue, 24 May 2022 17:27:03 -0600 Subject: Fix CSRF loading on static GET pages --- srv/src/http/tpl/assets.html | 2 ++ srv/src/http/tpl/edit-post.html | 2 ++ srv/src/http/tpl/load-csrf.html | 13 +++++++++++++ srv/src/http/tpl/posts.html | 3 ++- 4 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 srv/src/http/tpl/load-csrf.html (limited to 'srv/src/http/tpl') diff --git a/srv/src/http/tpl/assets.html b/srv/src/http/tpl/assets.html index aa5e422..86e0ba5 100644 --- a/srv/src/http/tpl/assets.html +++ b/srv/src/http/tpl/assets.html @@ -46,6 +46,8 @@ +{{ template "load-csrf.html" . }} + {{ end }} {{ template "base.html" . }} diff --git a/srv/src/http/tpl/edit-post.html b/srv/src/http/tpl/edit-post.html index 114369a..48af882 100644 --- a/srv/src/http/tpl/edit-post.html +++ b/srv/src/http/tpl/edit-post.html @@ -99,6 +99,8 @@ + {{ template "load-csrf.html" . }} + {{ end }} {{ template "base.html" . }} diff --git a/srv/src/http/tpl/load-csrf.html b/srv/src/http/tpl/load-csrf.html new file mode 100644 index 0000000..b0757f9 --- /dev/null +++ b/srv/src/http/tpl/load-csrf.html @@ -0,0 +1,13 @@ + + + diff --git a/srv/src/http/tpl/posts.html b/srv/src/http/tpl/posts.html index c3aad0c..0609ff6 100644 --- a/srv/src/http/tpl/posts.html +++ b/srv/src/http/tpl/posts.html @@ -20,7 +20,6 @@ {{ $csrfFormInput := .CSRFFormInput }} -

@@ -56,6 +55,8 @@ {{ template "posts-nextprev" . }} + {{ template "load-csrf.html" . }} + {{ end }} {{ template "base.html" . }} -- cgit v1.2.3