mirror of
https://github.com/Laxilef/OTGateway.git
synced 2025-12-26 01:53:35 +05:00
refactor: added `no-cache`
This commit is contained in:
16
index.html
16
index.html
@@ -105,7 +105,9 @@
|
|||||||
try {
|
try {
|
||||||
fwVersion.disabled = true;
|
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();
|
const data = await response.json();
|
||||||
|
|
||||||
for (let release of data) {
|
for (let release of data) {
|
||||||
@@ -133,7 +135,9 @@
|
|||||||
let files = [];
|
let files = [];
|
||||||
|
|
||||||
try {
|
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();
|
const assets = await response.json();
|
||||||
|
|
||||||
for (const file of assets) {
|
for (const file of assets) {
|
||||||
@@ -164,7 +168,9 @@
|
|||||||
fwBoard.remove(1);
|
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();
|
const boards = await response.json();
|
||||||
|
|
||||||
for (let board of boards) {
|
for (let board of boards) {
|
||||||
@@ -264,7 +270,9 @@
|
|||||||
statusContainer.textContent = "Downloading files...";
|
statusContainer.textContent = "Downloading files...";
|
||||||
|
|
||||||
for (let file of 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 firmwareArrayBuffer = await response.arrayBuffer();
|
||||||
const uint8Array = new Uint8Array(firmwareArrayBuffer);
|
const uint8Array = new Uint8Array(firmwareArrayBuffer);
|
||||||
file.data = "";
|
file.data = "";
|
||||||
|
|||||||
Reference in New Issue
Block a user