about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--src/app.ts11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/app.ts b/src/app.ts
index 1b8bcf7..f41d6f2 100644
--- a/src/app.ts
+++ b/src/app.ts
@@ -214,6 +214,17 @@ export const server = {
             status: status,
             headers: { location: newpath },
           });
+        } else if (files.has(pathname.replace(/index.html$/, ""))) {
+          newpath = pathname.replace(/index.html$/, "");
+          metrics.requests.inc({
+            method: request.method,
+            path: newpath,
+            status_code: (status = 302),
+          });
+          return new Response("", {
+            status: status,
+            headers: { location: newpath },
+          });
         }
         metrics.requests.inc({
           method: request.method,