fix: inject db context for /s/* short share URL route
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:
@@ -135,6 +135,10 @@ app.use("/api/*", async (c, next) => {
|
|||||||
c.set("db", prodDb);
|
c.set("db", prodDb);
|
||||||
return next();
|
return next();
|
||||||
});
|
});
|
||||||
|
app.use("/s/*", async (c, next) => {
|
||||||
|
c.set("db", prodDb);
|
||||||
|
return next();
|
||||||
|
});
|
||||||
|
|
||||||
// Rate limiting for public endpoints (per D-07, D-08)
|
// Rate limiting for public endpoints (per D-07, D-08)
|
||||||
const browseTier = createRateLimit(120, 60_000);
|
const browseTier = createRateLimit(120, 60_000);
|
||||||
|
|||||||
Reference in New Issue
Block a user