From f2db7cd5299866d5b0c927335cd921f0dced2f1e Mon Sep 17 00:00:00 2001 From: Yurii Date: Thu, 9 Jan 2025 04:26:44 +0300 Subject: [PATCH] refactor: corsproxy replaced --- index.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index c53ceec..4e6f228 100644 --- a/index.html +++ b/index.html @@ -92,6 +92,7 @@ import { ESPLoader, Transport } from "https://unpkg.com/esptool-js/bundle.js"; let esploader = null; + const corsProxy = "https://corsproxy.laxilef.workers.dev/?"; const fwVersion = document.querySelector("[name='fwVersion']"); const fwBoardContainer = document.querySelector(".fwBoardContainer"); const fwBoard = document.querySelector("[name='fwBoard']"); @@ -168,7 +169,7 @@ fwBoard.remove(1); } - const response = await fetch(`https://corsproxy.io/?url=${configUrl}`, { + const response = await fetch(`${corsProxy}${configUrl}`, { cache: "no-cache" }); const boards = await response.json(); @@ -270,7 +271,7 @@ statusContainer.textContent = "Downloading files..."; for (let file of files) { - const response = await fetch(`https://corsproxy.io/?url=${file.url}`, { + const response = await fetch(`${corsProxy}${file.url}`, { cache: "no-cache" }); const firmwareArrayBuffer = await response.arrayBuffer();