Fix Atom feed route issue

This commit is contained in:
Râu Cao 2024-10-22 12:48:57 +02:00
parent 3914ca25a1
commit ea58c1f60b
Signed by: raucao
GPG Key ID: 37036C356E56CC51

View File

@ -27,9 +27,12 @@ router.get("/:path", async (ctx: ctx) => {
}); });
router.get("/:user/:kind.atom", async (ctx: ctx) => { router.get("/:user/:kind.atom", async (ctx: ctx) => {
const { user } = ctx.params; const { user, kind } = ctx.params;
if (user.startsWith("@") || user.startsWith("~") || kind === "articles") { if (
kind === "articles" &&
(user.startsWith("@") || user.startsWith("~"))
) {
await userAtomFeedHandler(ctx); await userAtomFeedHandler(ctx);
} else { } else {
ctx.response.status = 404; ctx.response.status = 404;