diff --git a/server/scripts/modules/utilities.js b/server/scripts/modules/utilities.js index 493fb69..97559a8 100644 --- a/server/scripts/modules/utilities.js +++ b/server/scripts/modules/utilities.js @@ -177,8 +177,8 @@ const utils = (() => { let corsUrl = _url; if (params.cors === true) corsUrl = rewriteUrl(_url); const url = new URL(corsUrl, `${window.location.origin}/`); - // match the security protocol - url.protocol = window.location.protocol; + // match the security protocol when not on localhost + url.protocol = window.location.hostname !== 'localhost' ? window.location.protocol : url.protocol; // add parameters if necessary if (params.data) { Object.keys(params.data).forEach((key) => {