all repos — website @ 34c1d734dcce8218f31dab8b314685c02bda1847

My website

Normalise case of Host header

Alan Pearce
commit

34c1d734dcce8218f31dab8b314685c02bda1847

parent

7575fd600d390ca524cd8595ede9057943045c11

1 file changed, 1 insertion(+), 1 deletion(-)

changed files
M src/app.tssrc/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;