Skip to content

Fix URLs in the `Link` header for `GET /projects/:id/repository/contributors` when no value is passed for `order_by` or `sort`

What does this MR do?

This fixes URLs in the Link header for GET /projects/:id/repository/contributors when no value is passed for order_by or sort.

Are there points in the code the reviewer needs to double check?

A more robust (but also with potential bigger/unknown consequences) would be to replace params with declared_params(include_missing: false) in API::Helpers::Pagination#pagination_links (I've quickly checked and that seems to work).

Why was this MR needed?

To fix a regression where the URLs generated in the Link header for GET /projects/:id/repository/contributors would be incorrect and return a order_by does not have a valid value, sort does not have a valid value error.

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

Closes #45363 (closed)

Edited by Rémy Coutable

Merge request reports