From ba0b9ecbc946ace7123b5975f412b974b1ef13a9 Mon Sep 17 00:00:00 2001 From: maxmcd Date: Fri, 21 Jun 2024 15:35:26 -0400 Subject: [PATCH] Return non-error status on warmup and delete internal headers --- deno-bootstrap/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/deno-bootstrap/index.ts b/deno-bootstrap/index.ts index 523aa43..618f746 100644 --- a/deno-bootstrap/index.ts +++ b/deno-bootstrap/index.ts @@ -34,7 +34,7 @@ const server = Deno.serve( const headerUrl = req.headers.get("X-Deno-Worker-URL"); if (!headerUrl) { // This is just for the warming request, shouldn't be seen by clients. - return Response.json({}, { status: 401 }); + return Response.json({}, { status: 200 }); } const url = new URL(headerUrl); // Deno Request headers are immutable so we must make a new Request in order @@ -53,6 +53,8 @@ const server = Deno.serve( ); req.headers.delete("X-Deno-Worker-URL"); + req.headers.delete("X-Deno-Worker-Host"); + req.headers.delete("X-Deno-Worker-Connection"); return mod.default.fetch(req); } );