put CSRF only for POST
This commit is contained in:
parent
c62f583dd4
commit
9dc6b6d588
@ -54,10 +54,10 @@ export async function request (path, method, body = null, auth = true) {
|
|||||||
}
|
}
|
||||||
if(method === "POST") {
|
if(method === "POST") {
|
||||||
content.body = prms.toString();
|
content.body = prms.toString();
|
||||||
|
content.headers.CSRFPreventionToken = getCookie("CSRFPreventionToken");
|
||||||
}
|
}
|
||||||
if(auth) {
|
if(auth) {
|
||||||
content.headers.Cookie = document.cookie;
|
content.headers.Cookie = document.cookie;
|
||||||
content.headers.CSRFPreventionToken = getCookie("CSRFPreventionToken");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let response = await fetch(`https://pve.tronnet.net/api2/json${path}`, content)
|
let response = await fetch(`https://pve.tronnet.net/api2/json${path}`, content)
|
||||||
|
Loading…
Reference in New Issue
Block a user