API: getting projects for users with dot gets 404
Summary
API calls to /users/:id/projects
endpoint gets wrong unexpected 404 not found error.
Although I only can verify existence of this behaviour with users without any personal project right now, because I can't fin any user with a dot in username and some public personal projects, I think user hesam.384 had got a personal project a week ago, when I wrote https://gitlab.com/gitlab-org/gitlab-ce/issues/22718#note_101497802.
Steps to reproduce
- Make an API call to
/users/:id/projects
endpoint for a user containing dot. - Get false 404 not found error.
What is the current bug behavior?
$ curl -I https://gitlab.com/api/v4/users/hesam.384/projects
HTTP/1.1 404 Not Found
Server: nginx
Date: Wed, 26 Sep 2018 20:41:07 GMT
Content-Type: application/json
Content-Length: 25
Cache-Control: no-cache
Vary: Origin
X-Request-Id: d814e96d-dced-4cb6-ae9b-9ebd564fbc0b
X-Runtime: 0.007749
RateLimit-Limit: 600
RateLimit-Observed: 2
RateLimit-Remaining: 598
RateLimit-Reset: 1537994527
RateLimit-ResetTime: Thu, 26 Sep 2018 20:42:07 GMT
What is the expected correct behavior?
(Both Ferrar and hesam.384 had got no personal project, so I expected the same result.)
$ curl -I https://gitlab.com/api/v4/users/Ferrar/projects
HTTP/1.1 200 OK
Server: nginx
Date: Wed, 26 Sep 2018 20:41:57 GMT
Content-Type: application/json
Content-Length: 2
Cache-Control: no-cache
Link: <https://gitlab.com/api/v4/users/Ferrar/projects?membership=false&order_by=created_at&owned=false&page=1&per_page=20&repository_checksum_failed=false&simple=false&sort=desc&starred=false&statistics=false&user_id=Ferrar&wiki_checksum_failed=false&with_custom_attributes=false&with_issues_enabled=false&with_merge_requests_enabled=false>; rel="first", <https://gitlab.com/api/v4/users/Ferrar/projects?membership=false&order_by=created_at&owned=false&page=1&per_page=20&repository_checksum_failed=false&simple=false&sort=desc&starred=false&statistics=false&user_id=Ferrar&wiki_checksum_failed=false&with_custom_attributes=false&with_issues_enabled=false&with_merge_requests_enabled=false>; rel="last"
Vary: Origin
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Next-Page:
X-Page: 1
X-Per-Page: 20
X-Prev-Page:
X-Request-Id: 30052e7a-28db-4624-9b9d-ae4a292798b5
X-Runtime: 0.027555
X-Total: 0
X-Total-Pages: 1
Strict-Transport-Security: max-age=31536000
RateLimit-Limit: 600
RateLimit-Observed: 1
RateLimit-Remaining: 599
RateLimit-Reset: 1537994577
RateLimit-ResetTime: Thu, 26 Sep 2018 20:42:57 GMT
Refs: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7500 https://gitlab.com/gitlab-org/gitlab-ce/issues/22718#note_104559584 https://gitlab.com/gitlab-org/gitlab-ce/issues/22718
Edited by H@di