Skip to content

Commit

Permalink
Return non-error status on warmup and delete internal headers
Browse files Browse the repository at this point in the history
  • Loading branch information
maxmcd committed Jun 21, 2024
1 parent b91ac26 commit ba0b9ec
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion deno-bootstrap/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
}
);
Expand Down

0 comments on commit ba0b9ec

Please sign in to comment.