refactor: added `no-cache`

This commit is contained in:
Yurii
2025-01-07 07:36:57 +03:00
parent 4c42c148f8
commit de7c178bf1

View File

@@ -105,7 +105,9 @@
try {
fwVersion.disabled = true;
const response = await fetch("https://api.github.com/repos/Laxilef/OTGateway/releases");
const response = await fetch("https://api.github.com/repos/Laxilef/OTGateway/releases", {
cache: "no-cache"
});
const data = await response.json();
for (let release of data) {
@@ -133,7 +135,9 @@
let files = [];
try {
const response = await fetch(`https://api.github.com/repos/Laxilef/OTGateway/releases/${releaseId}/assets`);
const response = await fetch(`https://api.github.com/repos/Laxilef/OTGateway/releases/${releaseId}/assets`, {
cache: "no-cache"
});
const assets = await response.json();
for (const file of assets) {
@@ -164,7 +168,9 @@
fwBoard.remove(1);
}
const response = await fetch(`https://corsproxy.io/?url=${configUrl}`);
const response = await fetch(`https://corsproxy.io/?url=${configUrl}`, {
cache: "no-cache"
});
const boards = await response.json();
for (let board of boards) {
@@ -264,7 +270,9 @@
statusContainer.textContent = "Downloading files...";
for (let file of files) {
const response = await fetch(`https://corsproxy.io/?url=${file.url}`);
const response = await fetch(`https://corsproxy.io/?url=${file.url}`, {
cache: "no-cache"
});
const firmwareArrayBuffer = await response.arrayBuffer();
const uint8Array = new Uint8Array(firmwareArrayBuffer);
file.data = "";