Skip to content

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

Closed
@Svra44

Description

@Svra44
  • Gitea version (or commit ref): 1.12.4
  • Git version: 2.20.1
  • Operating system: Debian 10.5
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions