Skip to content

Recent "Url scheme" commit breaks redirects (404s) when the "root url" is in a subdirectory #2805

Closed
@wyattoday

Description

@wyattoday
  • Gitea version (or commit ref): 513375c
  • Git version: 2.14.3
  • Operating system: Linux
  • 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:

Description

Use a ROOT_URL in your config in a directory other than the "root" directory. For example, https://example.com/git/

The problem is that the "Commits" link at the top of a repository view has the form /BASE_DIR/COMPANY_NAME/REPOSITORY_NAME/commits/master when it should be /BASE_DIR/COMPANY_NAME/REPOSITORY_NAME/commits/branch/master (as per the latest commit: 513375c ).

However, if you click the current "Commits" link it incorrect drops the "subdirectory" part of the URL. Meaning Gitea currently incorrectly redirects to /COMPANY_NAME/REPOSITORY_NAME/commits/branch/master instead of /BASE_DIR/COMPANY_NAME/REPOSITORY_NAME/commits/branch/master. Meaning, the current redirection code assumes the gitea installation is in the root directory. Which, for us that's not true.

The breaking changes were in this commit: 513375c

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue/regressionIndicates a previously functioning feature or behavior that has broken or regressed after a changetype/bug

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions