From 88d56db7ff64c131dad8ee6ea25a209614d080ae Mon Sep 17 00:00:00 2001 From: lakhoune Date: Mon, 11 Sep 2023 11:23:47 +0200 Subject: [PATCH] try cors fix --- src/statistics/canvas-overlay.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/statistics/canvas-overlay.js b/src/statistics/canvas-overlay.js index 8bd2f5ad..799fab3d 100644 --- a/src/statistics/canvas-overlay.js +++ b/src/statistics/canvas-overlay.js @@ -53,7 +53,14 @@ class CanvasStatsOverlay extends LitElement { const url = `${config.pm4botsEndpoint}/bot/${botName}/enhanced-model`; console.log(url); try { - const response = await fetch(url, { mode: "no-cors", timeout: 10000 }); + const response = await fetch(url, { + mode: "no-cors", + timeout: 10000, + headers: { + "Access-Control-Allow-Origin": "*", + "Content-Type": "application/json", + }, + }); if (!response.ok) { this.loading = false; return;