From c849e3d66221e4bc8f71acf1cb11b8b1bb5a66ff Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B6rn=20K=C3=BCnsem=C3=B6ller?=
 <jkuensem@physik.uni-bielefeld.de>
Date: Fri, 21 Jul 2023 15:00:47 +0200
Subject: [PATCH] TMSS-2576: set referer and csrftoken in
 tmss_http_rest_client.py requests

---
 SAS/TMSS/client/lib/tmss_http_rest_client.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/SAS/TMSS/client/lib/tmss_http_rest_client.py b/SAS/TMSS/client/lib/tmss_http_rest_client.py
index e2604559ccc..d736c434d34 100644
--- a/SAS/TMSS/client/lib/tmss_http_rest_client.py
+++ b/SAS/TMSS/client/lib/tmss_http_rest_client.py
@@ -188,6 +188,8 @@ class TMSSsession(object):
             request_method = self.session.options
 
         if 'csrftoken' in self.session.cookies:
+            if headers is None:
+                headers = dict()
             headers.update({'Referer': self.host_url, 'X-CSRFToken': self.session.cookies['csrftoken']})
 
         for attempt_nr in range(attempt_count):
-- 
GitLab