Restrict pagination per_page possible values
What does this MR do and why?
Sentry error: https://sentry.gitlab.net/gitlab/gitlabcom/issues/3168349
Problem
Providing 0
value for per_page
causes various internal errors.
Solution
- Do not allow to provide 0 for per_page
- Return API error when this happens
We can consider restricting all negative values as well. However, it might brake existing integrations.
Screenshots or screen recordings
How to set up and validate locally
http://127.0.0.1:3000/api/v4/projects/6/repository/tags?per_page=0
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.