all repos — homestead @ 4e71dbf346c4a9476df948daf9d3a308a263125c

Code for my website

fix possible redirect loop

Alan Pearce
commit

4e71dbf346c4a9476df948daf9d3a308a263125c

parent

7575406976387391172f12acf019c8e8ad3b09ef

1 file changed, 4 insertions(+), 1 deletion(-)

jump to
M src/app.tssrc/app.ts
@@ -217,7 +217,10 @@ return new Response("", {
status: status, headers: { location: newpath }, }); - } else if (files.has(pathname.replace(/index.html$/, ""))) { + } else if ( + pathname.endsWith("index.html") && + files.has(pathname.replace(/index.html$/, "")) + ) { newpath = pathname.replace(/index.html$/, ""); metrics.requests.inc({ content_encoding: contentEncoding,