mirror of
https://git.bsd.gay/fef/nyastodon.git
synced 2024-12-24 18:13:42 +01:00
Do not set CSRF Token when no csrf header (#10383)
This commit is contained in:
parent
792a0f106e
commit
68f2211f00
1 changed files with 6 additions and 2 deletions
|
@ -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…
Reference in a new issue