projects
/
diaspy.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
11ad75e
)
Fix add X-CSRF-Token when it is missing
author
Marek Marecki
<marekjm@ozro.pw>
Sun, 23 Apr 2017 13:44:31 +0000
(15:44 +0200)
committer
Marek Marecki
<marekjm@ozro.pw>
Sun, 23 Apr 2017 13:44:31 +0000
(15:44 +0200)
diaspy/connection.py
patch
|
blob
|
blame
|
history
diff --git
a/diaspy/connection.py
b/diaspy/connection.py
index c2447760d78480edcd3c83604c30aaf33eb08166..003314cd5e012630151ed204fa6489e521b1450c 100644
(file)
--- a/
diaspy/connection.py
+++ b/
diaspy/connection.py
@@
-129,7
+129,9
@@
class Connection():
:type headers: dict
"""
string = '{0}/{1}'.format(self.pod, string)
- request = self._session.delete(string, data=data, headers=headers, **kwargs)
+ if 'X-CSRF-Token' not in headers:
+ headers['X-CSRF-Token'] = self.get_token()
+ request = self._session.delete(string, data=data, headers=headers, verify=self._verify_SSL, **kwargs)
return request
def _setlogin(self, username, password):