about summary refs log tree commit diff stats
path: root/src/app.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/app.ts')
-rw-r--r--src/app.ts7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/app.ts b/src/app.ts
index e0fe2e8..1b8bcf7 100644
--- a/src/app.ts
+++ b/src/app.ts
@@ -129,6 +129,7 @@ export const server = {
     const pathname = url.pathname.replace(/\/\/+/g, "/");
     const endTimer = metrics.requestDuration.startTimer({ path: pathname });
     let status;
+    let newpath;
     const transaction = Sentry.startTransaction({
       name: pathname,
       op: "http.server",
@@ -203,7 +204,7 @@ export const server = {
         });
       } else {
         if (files.has(pathname + "/")) {
-          log.info(`Redirecting to: ${pathname + "/"}`);
+          newpath = pathname + "/";
           metrics.requests.inc({
             method: request.method,
             path: pathname,
@@ -211,7 +212,7 @@ export const server = {
           });
           return new Response("", {
             status: status,
-            headers: { location: pathname + "/" },
+            headers: { location: newpath },
           });
         }
         metrics.requests.inc({
@@ -249,7 +250,7 @@ export const server = {
       const seconds = endTimer();
       metrics.requestDuration.observe(seconds);
       transaction.finish();
-      console.log(request.method, status, pathname);
+      console.log(request.method, status, pathname, newpath ? newpath : "");
     }
   },
 } satisfies Serve;