From e5da8b39bed0597b1b09817cd2f42b68fcea849c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20De=20Boey?= Date: Tue, 29 Mar 2022 04:28:02 +0200 Subject: [PATCH] fix: omit path and query string from healthcheck route --- app/routes/healthcheck.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/routes/healthcheck.tsx b/app/routes/healthcheck.tsx index 8ca82e9b..79d4a3b0 100644 --- a/app/routes/healthcheck.tsx +++ b/app/routes/healthcheck.tsx @@ -7,11 +7,12 @@ export const loader: LoaderFunction = async ({ request }) => { request.headers.get("X-Forwarded-Host") ?? request.headers.get("host"); try { + const url = new URL("/", `http://${host}`); // if we can connect to the database and make a simple query // and make a HEAD request to ourselves, then we're good. await Promise.all([ prisma.user.count(), - fetch(`http://${host}`, { method: "HEAD" }).then((r) => { + fetch(url.toString(), { method: "HEAD" }).then((r) => { if (!r.ok) return Promise.reject(r); }), ]);