Bug
GET /api/tags/popular currently parses its limit query with:
Math.max(parseInt(searchParams.get(limit) || 50, 10) || 50, 1)
Because 0 || 50 evaluates to 50, requesting /api/tags/popular?limit=0 expands to the default 50 results instead of clamping to the documented minimum bound of 1. The ad hoc parser also partially accepts malformed numeric strings.
Expected
Use the existing shared bounded pagination parser so limit=0 clamps to 1, malformed values fall back to 50, and oversized values cap at 200.
Proposed fix
Replace the local expression with parsePaginationParam(...) and add focused route coverage for zero, malformed, and oversized values.
Paid task context: https://ugig.net/gigs/abd6b2a0-e728-48cf-a46f-f99e419ed94e
Bug
GET /api/tags/popularcurrently parses itslimitquery with:Because
0 || 50evaluates to50, requesting/api/tags/popular?limit=0expands to the default50results instead of clamping to the documented minimum bound of1. The ad hoc parser also partially accepts malformed numeric strings.Expected
Use the existing shared bounded pagination parser so
limit=0clamps to1, malformed values fall back to50, and oversized values cap at200.Proposed fix
Replace the local expression with
parsePaginationParam(...)and add focused route coverage for zero, malformed, and oversized values.Paid task context: https://ugig.net/gigs/abd6b2a0-e728-48cf-a46f-f99e419ed94e