Stopped redirecting when using lowercase repo names #8565

Closed
opened 2025-11-02 08:10:56 -06:00 by GiteaMirror · 0 comments
Owner

Originally created by @AbdulrhmnGhanem on GitHub (Feb 15, 2022).

Gitea Version

609c91665

Git Version

No response

Operating System

No response

How are you running Gitea?

https://try.gitea.io

Database

No response

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Description

  • Previously, GET {username}/{reponame}/raw///file-path (the middle two slashes are blank to get the default branch) when the repo name has uppercase letters, e.g., https://try.gitea.io/AbdulrhmnGhanem/CH330_Hardware, using a lowercase version of the name redirected to the correct URL

  • In other words, both

    • GET https://try.gitea.io/AbdulrhmnGhanem/CH330_Hardware/raw///images/back.png
    • GET https://try.gitea.io/AbdulrhmnGhanem/ch330_hardware/raw///images/back.png

    were redirecting to
    GET https://try.gitea.io/AbdulrhmnGhanem/CH330_Hardware/raw/branch/master/images/back.png
    This isn't the case after #17551. Specifically because of this line.

Screenshots

No response

Originally created by @AbdulrhmnGhanem on GitHub (Feb 15, 2022). ### Gitea Version 609c91665 ### Git Version _No response_ ### Operating System _No response_ ### How are you running Gitea? https://try.gitea.io ### Database _No response_ ### Can you reproduce the bug on the Gitea demo site? Yes ### Log Gist _No response_ ### Description * Previously, `GET {username}/{reponame}/raw///file-path` (the middle two slashes are blank to get the default branch) when the repo name has uppercase letters, e.g., https://try.gitea.io/AbdulrhmnGhanem/CH330_Hardware, using a lowercase version of the name redirected to the correct URL * In other words, both * `GET https://try.gitea.io/AbdulrhmnGhanem/CH330_Hardware/raw///images/back.png` * `GET https://try.gitea.io/AbdulrhmnGhanem/ch330_hardware/raw///images/back.png` were redirecting to ``` GET https://try.gitea.io/AbdulrhmnGhanem/CH330_Hardware/raw/branch/master/images/back.png``` This isn't the case after #17551. Specifically because of this [line](https://github.com/zeripath/gitea/blob/cbd5eecd148dfca5fcb1a3da469e491a84f6b32b/modules/context/repo.go#L860). ### Screenshots _No response_
GiteaMirror added the type/enhancement label 2025-11-02 08:10:56 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#8565