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