Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion apps/lists/src/lists.app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,8 @@ const app = new Hono<App>()
// Echoed, but only when it fits the byte the client reads it back into — anything
// outside 0–255 can't round-trip, so a nonsense `?type=` gets the default instead of a
// number that would break the response on the way in.
const type = Number.parseInt(c.req.query('type') ?? '', 10)
const rawType = (c.req.query('type') ?? '').trim()
const type = /^-?\d+$/.test(rawType) ? Number(rawType) : Number.NaN
const echoed =
type >= 0 && type <= MAX_LIST_ENTITY_TYPE ? type : DEFAULT_ALGORITHMIC_LIST_TYPE

Expand Down
Loading