500 error when viewing blame or history of file with newline in filename
Summary
When viewing the blame or history of a file with a newline character in its filename, the user will receive of 500 error page.
Steps to reproduce
- On one's own machine, create a repository that contains a file with a newline character in its filename.
- Upload the repository to Gitlab.
- Select the file with the newline character from the project page.
- Select either the "Blame" or "History" view for that file.
- You should see a 500 error page.
Example Project
https://gitlab.com/jessehall3/filenames_with_newlines
What is the current bug behavior?
The user see a 500 error page.
What is the expected correct behavior?
The user should see the blame or history views.
Output of checks
This bug happens on GitLab.com
Possible fixes
After addressing a very similar issue in a previous merge request, I can see the issue is with the routing constraints on L37 in config/routes/repository.rb.
I plan on submitting a merge request for this issue shortly after completing this issue.