Skip to contentSkip to conversation

Call csrf function in all pages to ensure cookie is sent

PATCH New brian avery 1 participant 2 messages Aug 18, 2015

lore
Share & tools
lore
#0 lore raw

cover Call csrf function in all pages to ensure cookie is sent

Simple addition of cross site request forgery protection to base page so it is inherited everywhere.

The following changes since commit c348fa50186fb0796bc7b793c4b8d710419f2a0d:

bitbake: toaster: move code from setup_lv_tests to setUp (2015-08-17 14:41:45 +0100)

are available in the git repository at:

git://git.yoctoproject.org/poky-contrib bavery/submit/michaelw/20150817_csrf_added_base
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=bavery/submit/michaelw/20150817_csrf_added_base

Michael Wood (1):
toastergui: Call csrf function in all pages to ensure cookie is sent

 lib/toaster/toastergui/templates/base.html | 1 +
 1 file changed, 1 insertion(+)
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/1 toastergui: Call csrf function in all pages to ensure cookie is sent

From: Michael Wood <[email protected]>

Not all pages call the csrf token template function so django does not bother to send the cookike, this meant that all subsequent ajax calls fail. So add this to the base template.

[YOCTO #8175]

---
 lib/toaster/toastergui/templates/base.html | 1 +
 1 file changed, 1 insertion(+)
lib/toaster/toastergui/templates/base.html +1 -0
index d75bf16..f187100 100644
@@ -69,6 +69,7 @@
 
 <body style="height: 100%">
 
+  {% csrf_token %}
   <div id="loading-notification" class="alert lead text-center" style="display:none">
     Loading <i class="fa-pulse icon-spinner"></i>
   </div>
Signature · 1 line
1.9.1