go-gitea / gitea

Git with a cup of tea! Painless self-hosted all-in-one software development service, including Git hosting, code review, team collaboration, package registry and CI/CD
https://gitea.com
MIT License
44.59k stars 5.45k forks source link

404 error on View File for Commits with Spaces in File/Folder #12872

Closed Svra44 closed 4 years ago

Svra44 commented 4 years ago

gitea[10132]: [Macaron] 2020-09-16 22:45:50: Started GET /TestUser1/tmpGit/src/commit/23bfc188a8d3fed0156640551136192fbe2588d7/th for 192.168.0.10 gitea[10132]: [Macaron] 2020-09-16 22:45:50: Completed GET /TestUser1/tmpGit/src/commit/23bfc188a8d3fed0156640551136192fbe2588d7/th 404 Not Found in 4.921573ms

gitea[10132]: [Macaron] 2020-09-16 22:48:26: Started GET /TestUser1/tmpGit/src/commit/23bfc188a8d3fed0156640551136192fbe2588d7/file%20with%20spaces.txt for 127.0.0.1 gitea[10132]: [Macaron] 2020-09-16 22:48:26: Completed GET /TestUser1/tmpGit/src/commit/23bfc188a8d3fed0156640551136192fbe2588d7/file%20with%20spaces.txt 200 OK in 7.585426ms

Description

Gitea appears to incorrectly handle the "View File" option when viewing commits to files with spaces either in the file name, or in the containing directory structure. Have tested in both FF 80.0.1 & Chromium 85.0.4183.102

When accessing a commit view, & selecting the "View File" option, it redirects to an incorrect link. Example:

Tested directly against gitea localhost:3000 bind, taking reverse proxy out of the chain. Same git repo uploaded to try.gitea.io doesnt exhibit the same issue.

Screenshots

image image image

mrsdizzie commented 4 years ago

Duplicate of #12768 and should be fixed in 1.12.5 by #12776