mirror of
https://github.com/graphql-python/graphene-django.git
synced 2025-06-30 18:33:16 +03:00
Remove duplicate code
This commit is contained in:
parent
e33523e992
commit
9710d008f4
|
@ -51,13 +51,6 @@
|
||||||
Accept: 'application/json',
|
Accept: 'application/json',
|
||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json'
|
||||||
};
|
};
|
||||||
|
|
||||||
var cookies = document.cookie.split(';').reduce((p, c) => {
|
|
||||||
let x = {};
|
|
||||||
let key = c.split('=')[0].trim();
|
|
||||||
x[key] = p[key] ? p[key].concat([c.split('=')[1]]) : [c.split('=')[1]];
|
|
||||||
return Object.assign(p, x);
|
|
||||||
}, {});
|
|
||||||
if (cookies.csrftoken && cookies.csrftoken.length) {
|
if (cookies.csrftoken && cookies.csrftoken.length) {
|
||||||
headers['X-CSRFToken'] = cookies.csrftoken.pop();
|
headers['X-CSRFToken'] = cookies.csrftoken.pop();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user