Skip to content

Ensure dots in project and group ID are allowed in the API endpoints

What does this MR do?

The issue is well described here: https://gitlab.com/gitlab-org/gitlab-ce/issues/27988#note_25342521

This merge request adds a requirement for the :id (or :project_id) param in all the endpoints namespaced under /projects or /groups. Here, :id is a project (or group) ID or full path, which can contain a dot (.). Adding this requirement solves the issue where the route would return a 404.

We're already using this similar "hack" for branches' names in various API endpoints (e.g. https://gitlab.com/gitlab-org/gitlab-ce/blob/master/lib/api/branches.rb#L32).

Closes #27988 (closed) /cc @geoandri

Merge request reports