From eb03a81152883b5371b2a4519f98bae1d71065dd Mon Sep 17 00:00:00 2001 From: Nicolas Date: Thu, 5 Sep 2024 12:55:04 -0300 Subject: [PATCH] Update crawl-status.ts --- apps/api/src/controllers/v1/crawl-status.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/api/src/controllers/v1/crawl-status.ts b/apps/api/src/controllers/v1/crawl-status.ts index 05144a9b..ad4d21d2 100644 --- a/apps/api/src/controllers/v1/crawl-status.ts +++ b/apps/api/src/controllers/v1/crawl-status.ts @@ -94,7 +94,8 @@ export async function crawlStatusController(req: RequestWithAuth x.returnvalue); - const nextURL = new URL(`${req.protocol}://${req.get("host")}/v1/crawl/${req.params.jobId}`); + const protocol = process.env.ENV === "local" ? req.protocol : "https"; + const nextURL = new URL(`${protocol}://${req.get("host")}/v1/crawl/${req.params.jobId}`); nextURL.searchParams.set("skip", (start + data.length).toString());