From 160d50a2d2f38fab20aa31b61e680777d5a7633f Mon Sep 17 00:00:00 2001 From: Krzysiek Egzmont Date: Fri, 6 Oct 2023 17:24:09 +0200 Subject: [PATCH] change cors proxy --- js/tool_patcher.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/js/tool_patcher.js b/js/tool_patcher.js index 6e81b16..e1d2d6b 100644 --- a/js/tool_patcher.js +++ b/js/tool_patcher.js @@ -37,12 +37,11 @@ function loadFirmwareFromUrl(theUrl) { document.getElementById('console').value = ""; log("Loading file from url: "+ theUrl+'\n') - fetch('https://api.codetabs.com/v1/proxy?quest=' + theUrl, { - // headers: { - // 'Access-Control-Allow-Origin':'*' - // 'x-cors-api-key': 'temp_2f1bf656ef75047798830d7dbbc09bd6' - // } - }) + let res = null; + + fetch('https://corsproxy.egzi.ovh/' + theUrl).catch(err => { + return fetch('https://api.codetabs.com/v1/proxy?quest=' + theUrl); + }) .then(res => { if (res.ok) { return res.arrayBuffer();