Namespaces API returns a 404 for namespaces with a period in them

Summary

When trying to use the namespaces api to determine the kind on our enterprise install, we found that the api returned a 404 for namespaces with periods in them.

This bug appears to affect every version of gitlab, including gitlab.com. So I'll be demonstrating it with gitlab.com below.

Steps to reproduce

Compare

curl -v -header "Private-Token: YOURTOKEN" https://gitlab.com/api/v4/namespaces/elliott.m.butler

with

curl -v -header "Private-Token: YOURTOKEN" https://gitlab.com/api/v4/namespaces?search=elliott.m.butler

Example Project

N/A - Can be demonstrated with a simple curl

What is the current bug behavior?

Returns

{"error":"404 Not Found"}

What is the expected correct behavior?

Returns

{"id":1975552,"name":"elliott.m.butler","path":"elliott.m.butler","kind":"user","full_path":"elliott.m.butler","parent_id":null,"trial_ends_on":null,"plan":"free"}

Relevant logs and/or screenshots

N/A

Output of checks

This bug happens on GitLab.com

Possible fixes

N/A

Assignee Loading
Time tracking Loading