Skip to content

API /repos​/{owner}​/{repo}​/raw​/{filepath} fails if filepath is 40-char long #17179

Closed
@danielemoroni

Description

@danielemoroni

Gitea Version

1.12.3

Git Version

No response

Operating System

No response

How are you running Gitea?

I deployed an official download to my server

Database

No response

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Description

The Gitea API GET /repos​/{owner}​/{repo}​/raw​/{filepath} fails with http error 404 (or "object does not exist" in the latest gitea version) if the filepath is 40-character long.

I replicated the issue on https://try.gitea.io/danielemoroni/raw_api:
. This fails:
https://try.gitea.io/api/v1/repos/danielemoroni/raw_api/raw/filename_40char_long_xxxxxxxxxxxxxxx.txt
. This succeeds:
https://try.gitea.io/api/v1/repos/danielemoroni/raw_api/raw/filename_41char_long_xxxxxxxxxxxxxxxx.txt

The files are actually identical. I can retrieve them both without problems with another API, e.g.
https://try.gitea.io/danielemoroni/raw_api/src/branch/master/filename_40char_long_xxxxxxxxxxxxxxx.txt

Screenshots

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    modifies/apiThis PR adds API routes or modifies themtype/bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions