From 04f3129f232907f2e4cc3e5733408ce1c2dc8300 Mon Sep 17 00:00:00 2001 From: tferns Date: Fri, 14 Apr 2023 12:54:28 +0100 Subject: [PATCH] BAU: Add window.location.origin to fetches --- .../engine/views/components/clientsidefileuploadfield.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runner/src/server/plugins/engine/views/components/clientsidefileuploadfield.html b/runner/src/server/plugins/engine/views/components/clientsidefileuploadfield.html index f878ec8b67..f9f34cdde5 100644 --- a/runner/src/server/plugins/engine/views/components/clientsidefileuploadfield.html +++ b/runner/src/server/plugins/engine/views/components/clientsidefileuploadfield.html @@ -315,7 +315,7 @@ const deleteFileBackend = (file) => { let fetchUrl = `/s3/${uniquePath}/delete-file-by-key${window.location.search}`; - fetch(fetchUrl, { + fetch(window.location.origin + fetchUrl, { method: "DELETE", headers: {"Content-Type": "application/json"}, body: JSON.stringify({filename: file.name}), @@ -369,7 +369,7 @@ const getPreSignedUrl = async (file) => { let fetchUrl = `/s3/${uniquePath}/create-pre-signed-url${window.location.search}`; - const response = await fetch(fetchUrl, { + const response = await fetch(window.location.origin + fetchUrl, { method: 'POST', body: JSON.stringify({filename: file.name}), headers: {'Content-Type': 'application/json'}