Add explicit cors mode to all pu-saves fetch calls
This commit is contained in:
@@ -5881,6 +5881,7 @@
|
||||
const blob = new Blob([compressed], { type: "application/octet-stream" });
|
||||
await fetch(`https://pu-saves.burrson.de/saves/${encodeURIComponent(save_name)}`, {
|
||||
method: "POST",
|
||||
mode: "cors",
|
||||
body: blob,
|
||||
});
|
||||
n.showToast("Save stored", `"${save_name}" was saved to the server.`, "success");
|
||||
@@ -5892,7 +5893,7 @@
|
||||
}
|
||||
static async populateServerSaves() {
|
||||
try {
|
||||
const res = await fetch("https://pu-saves.burrson.de/saves");
|
||||
const res = await fetch("https://pu-saves.burrson.de/saves", { mode: "cors" });
|
||||
const saves = await res.json();
|
||||
const select = $("#server-saves-select");
|
||||
if (!select.length) return;
|
||||
@@ -5910,7 +5911,7 @@
|
||||
const save_name = $("#server-saves-select").val();
|
||||
if (!save_name) return;
|
||||
try {
|
||||
const res = await fetch(`https://pu-saves.burrson.de/saves/${encodeURIComponent(save_name)}`);
|
||||
const res = await fetch(`https://pu-saves.burrson.de/saves/${encodeURIComponent(save_name)}`, { mode: "cors" });
|
||||
if (!res.ok) throw "Not found";
|
||||
const text = await res.text();
|
||||
if (n.hasScript(text)) throw "Script found!";
|
||||
|
||||
Reference in New Issue
Block a user