mirror of
https://framagit.org/tykayn/mastodon.git
synced 2023-08-25 08:33:12 +02:00
[Glitch] Do not set CSRF Token when no csrf header
Port 68f2211f00
to glitch-soc
This commit is contained in:
parent
89a0fa3053
commit
872eab5784
@ -13,10 +13,14 @@ export const getLinks = response => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
let csrfHeader = {};
|
let csrfHeader = {};
|
||||||
|
|
||||||
function setCSRFHeader() {
|
function setCSRFHeader() {
|
||||||
const csrfToken = document.querySelector('meta[name=csrf-token]').content;
|
const csrfToken = document.querySelector('meta[name=csrf-token]');
|
||||||
csrfHeader['X-CSRF-Token'] = csrfToken;
|
if (csrfToken) {
|
||||||
|
csrfHeader['X-CSRF-Token'] = csrfToken.content;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ready(setCSRFHeader);
|
ready(setCSRFHeader);
|
||||||
|
|
||||||
export default getState => axios.create({
|
export default getState => axios.create({
|
||||||
|
Loading…
Reference in New Issue
Block a user