Skip to content

Validate torrents pagination params#106

Merged
ralyodio merged 1 commit into
profullstack:masterfrom
phucnguyen1707:fix-torrents-pagination
Jun 17, 2026
Merged

Validate torrents pagination params#106
ralyodio merged 1 commit into
profullstack:masterfrom
phucnguyen1707:fix-torrents-pagination

Conversation

@phucnguyen1707

Copy link
Copy Markdown
Contributor

Fixes #105.\n\nThis tightens GET /api/torrents pagination parsing so Supabase range bounds stay safe and predictable. Malformed, negative, fractional, and unsafe integer values now fall back to bounded defaults instead of leaking NaN, negative offsets, or parseInt truncation into .range(). Valid limits are still capped at 100.\n\nValidation:\n- pnpm test src/app/api/torrents/pagination.test.ts\n- pnpm exec tsc --noEmit --pretty false\n- pnpm exec eslint src/app/api/torrents/route.ts src/app/api/torrents/pagination.test.ts\n- git diff --check\n- pre-commit full vitest suite: 150 files, 2245 passed, 3 skipped\n\nNote: local Node is v22.22.2 while package.json requests >=24.0.0, but targeted checks and the full pre-commit suite passed.

@ralyodio ralyodio merged commit 5bbb425 into profullstack:master Jun 17, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GET /api/torrents accepts invalid pagination params

2 participants