diff options
author | Alan Pearce | 2024-04-16 00:01:52 +0200 |
---|---|---|
committer | Alan Pearce | 2024-04-16 00:01:52 +0200 |
commit | 8906942e9cb48906a67e4b17919accf51c18edc5 (patch) | |
tree | 9941d3c1cead0c4f0f3636d56b942e28597e3129 /src/app.ts | |
parent | 3c5f2727364bcfc75fd39e4478a0cfe850a1de9f (diff) | |
download | website-8906942e9cb48906a67e4b17919accf51c18edc5.tar.lz website-8906942e9cb48906a67e4b17919accf51c18edc5.tar.zst website-8906942e9cb48906a67e4b17919accf51c18edc5.zip |
fix possible redirect loop
Diffstat (limited to 'src/app.ts')
-rw-r--r-- | src/app.ts | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/app.ts b/src/app.ts index 7d5e448..da339c0 100644 --- a/src/app.ts +++ b/src/app.ts @@ -217,7 +217,10 @@ export const server = { 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, |