fix: inject db context for /s/* short share URL route
All checks were successful
CI / ci (push) Successful in 1m22s
CI / e2e (push) Has been skipped
CI / deploy (push) Successful in 15s

The /s/:token route was registered outside the /api/* db middleware
scope, causing db to be undefined and a 500 error on share link access.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-13 20:01:48 +02:00
parent e21e1ec523
commit 1fbd9bc609

View File

@@ -135,6 +135,10 @@ app.use("/api/*", async (c, next) => {
c.set("db", prodDb);
return next();
});
app.use("/s/*", async (c, next) => {
c.set("db", prodDb);
return next();
});
// Rate limiting for public endpoints (per D-07, D-08)
const browseTier = createRateLimit(120, 60_000);