From 34c1d734dcce8218f31dab8b314685c02bda1847 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 7 Apr 2024 13:13:23 +0200 Subject: Normalise case of Host header --- src/app.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app.ts b/src/app.ts index 9735e79..a3c1c2f 100644 --- a/src/app.ts +++ b/src/app.ts @@ -135,7 +135,7 @@ export const server = { fetch: async function (request) { const url = new URL(request.url); const pathname = url.pathname.replace(/\/\/+/g, "/"); - const hostname = request.headers.get("host") || "unknown"; + const hostname = request.headers.get("host")?.toLowerCase() || "unknown"; const endTimer = metrics.requestDuration.startTimer({ path: pathname }); let status; let newpath; -- cgit 1.4.1