From f2116a7b2f42e421da4187f7d0639fa8e35c4a7e Mon Sep 17 00:00:00 2001 From: Doug Martin Date: Wed, 10 Jan 2024 10:33:09 -0500 Subject: [PATCH] fix: Ensure runnable urls use https protocol [PT-186645347] Some of the NGSA activities use http:// urls for the runnable sequence or activity and this causes the Firebase function to not find the resources as they are stored there using https urls. --- query-creator/create-query/steps/firebase.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/query-creator/create-query/steps/firebase.js b/query-creator/create-query/steps/firebase.js index 117b4c5..1904b5a 100644 --- a/query-creator/create-query/steps/firebase.js +++ b/query-creator/create-query/steps/firebase.js @@ -15,7 +15,12 @@ exports.getResource = async (runnableUrl, reportServiceSource) => { const activityUrl = searchParams.get("activity"); if (sequenceUrl || activityUrl) { runnableUrl = sequenceUrl || activityUrl; - runnableUrl = runnableUrl.replace("api/v1/", "").replace(".json", ""); + + // ensure https urls as that is how they are stored in Firebase and convert the api endpoint url to the runnable url + runnableUrl = runnableUrl + .replace("http:", "https:") + .replace("api/v1/", "") + .replace(".json", ""); } } const params = {