all repos — homestead @ 612046ae456432601f77f49857cfbe8007e6c5fb

Code for my website

Normalise case of Host header

Alan Pearce
commit

612046ae456432601f77f49857cfbe8007e6c5fb

parent

ffe116a38b1fc2642d59134ff6495ffb4d68ca04

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

jump to
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;