about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorAlan Pearce2024-04-07 13:13:23 +0200
committerAlan Pearce2024-04-07 13:13:23 +0200
commit34c1d734dcce8218f31dab8b314685c02bda1847 (patch)
treeb3ec9a703512527db7f442f6347fcc4d3636ad12 /src
parent7575fd600d390ca524cd8595ede9057943045c11 (diff)
downloadwebsite-34c1d734dcce8218f31dab8b314685c02bda1847.tar.lz
website-34c1d734dcce8218f31dab8b314685c02bda1847.tar.zst
website-34c1d734dcce8218f31dab8b314685c02bda1847.zip
Normalise case of Host header
Diffstat (limited to 'src')
-rw-r--r--src/app.ts2
1 files changed, 1 insertions, 1 deletions
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;