Handle bad feed path encoding (#9)

This commit is contained in:
phucnguyen1707 2026-06-12 11:07:24 +07:00 committed by GitHub
parent 3d4345b665
commit 8f4691584c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 28 additions and 4 deletions

View file

@ -118,6 +118,14 @@ describe("CommandBoard API contracts", () => {
expect(opmlBody).toContain("<opml");
});
it("rejects malformed encoded feed discovery paths as client errors", async () => {
const response = await fetch(`${baseUrl}/rss/discover/%E0%A4%A.xml`);
const body = await response.json() as { error: string };
expect(response.status).toBe(400);
expect(body).toEqual({ error: "Invalid path encoding" });
});
it("exposes sh1pt project and action contracts", async () => {
const projectsResponse = await fetch(`${baseUrl}/api/plugins/sh1pt/projects`);
const projectsBody = await projectsResponse.json() as { projects: Array<{ id: string; board: string; status: string; actions: number }> };