From 462bb82d42a4f730eb8e09dcd7f6602c1a3406cf Mon Sep 17 00:00:00 2001 From: Patrick Toy Date: Wed, 19 Jul 2023 14:59:03 +0200 Subject: [PATCH] fix: add 'keep-alive' header to healthcheck.tsx This fix resolves an issue where the healthcheck would fail because the connection would close prematurely. --- app/routes/healthcheck.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/routes/healthcheck.tsx b/app/routes/healthcheck.tsx index 6c520cea..edd4fcfd 100644 --- a/app/routes/healthcheck.tsx +++ b/app/routes/healthcheck.tsx @@ -13,7 +13,10 @@ export const loader = async ({ request }: LoaderArgs) => { // and make a HEAD request to ourselves, then we're good. await Promise.all([ prisma.user.count(), - fetch(url.toString(), { method: "HEAD" }).then((r) => { + fetch(url.toString(), { + method: "HEAD", + headers: { connection: "keep-alive" }, + }).then((r) => { if (!r.ok) return Promise.reject(r); }), ]);