diff options
-rw-r--r-- | src/app.ts | 7 |
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; |