Skip to content

Empty/404 on project details for projects with a name ending in `.json`

Summary

When a project repository path ends in .json, the project details (base slug at /username/projectname) fails to load and returns a 404. Other views, for example /activity and /issues are still rendered correctly when navigated to directly.

Steps to reproduce

  1. Create a new project with a valid name, like test. (Note that a project named test.json can not be created and fails with a gitlab-shell error).
  2. After the project is created, navigate the project settings.
  3. Change the "Repository path" to end with .json: test.json.
  4. Save the changes.
  5. Navigate to Project->Details.

What is the current bug behavior?

Visiting /username/test.json in a browser displays a blank page. A 404 is reported in the browsers developer tools.

What is the expected correct behavior?

The project details should be returned and rendered.

Output of checks

(If you are reporting a bug on GitLab.com, write: This bug happens on GitLab.com)

Results of GitLab environment info

  • gitlab-ee:nightly: 11.5.0-pre 34888f9a
  • Current gdk/gitlab: master@b875431ff35ccdfd59d99193d34ec59c8b3933fc

Possible fixes

Don't allow project slugs to end in .json.