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