Skip to content

Commit

Permalink
fix: Ensure runnable urls use https protocol [PT-186645347]
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dougmartin committed Jan 10, 2024
1 parent 77e5ab0 commit 2e55c2c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion query-creator/create-query/steps/firebase.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,13 @@ 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
.trim()
.replace(/^http\:/, "https:")
.replace("api/v1/", "")
.replace(".json", "");
}
}
const params = {
Expand Down

0 comments on commit 2e55c2c

Please sign in to comment.