From 0489dc7c33ffb32ce5919f248a3601efee80bb8b Mon Sep 17 00:00:00 2001 From: Donald Zou Date: Wed, 14 Aug 2024 10:57:41 -0400 Subject: [PATCH] Update fetch.js Fixed for running over HTTPS --- src/static/app/src/utilities/fetch.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/static/app/src/utilities/fetch.js b/src/static/app/src/utilities/fetch.js index bad0428..a24f54e 100644 --- a/src/static/app/src/utilities/fetch.js +++ b/src/static/app/src/utilities/fetch.js @@ -19,7 +19,8 @@ const getUrl = (url) => { if (apiKey){ return `${apiKey.host}${url}` } - return `//${window.location.host}${window.location.pathname}${url}` + return window.location.hostname === 'localhost' ? url + : `${window.location.protocol}//${window.location.host}${window.location.pathname}${url}` } export const fetchGet = async (url, params=undefined, callback=undefined) => {