From 11ce5b6ac22aa07e5747d3a7d210f924fba6b9f7 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 117b4c50..b019566d 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 = {