Protected branches API route returns 404 for branches with dots
Summary
Protected branches API route returns a 404 when requesting branches with dots in the name.
Steps to reproduce
- Create a protected branch where the name contains a dot
- Attempt to get that branch through the API such as
curl --request GET "PRIVATE-TOKEN: :token" 'https://gitlab.com/api/v4/projects/4188667/protected_branches/lots.of.dots
Example Project
https://gitlab.com/api/v4/projects/4188667/protected_branches/lots.of.dots
What is the current bug behavior?
API returns 404:
{"error":"404 Not Found"}
What is the expected correct behavior?
{"name":"lots.of.dots","push_access_levels":[{"access_level":0,"user_id":null,"group_id":null,"access_level_description":"No one"}],"merge_access_levels":[{"access_level":30,"user_id":null,"group_id":null,"access_level_description":"Developers + Masters"}]}]
Results of GitLab environment info
Reproduced on 10.3.5 and GitLab.com
Edited by Cindy Pallares 🦉