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 11ce5b6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 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,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 = {
Expand Down

0 comments on commit 11ce5b6

Please sign in to comment.