API endpoint /repos/{owner}/{repo}/raw/{filepath}?branch returns 404 in version 1.23.0 #13999

Closed
opened 2025-11-02 10:59:40 -06:00 by GiteaMirror · 5 comments
Owner

Originally created by @snogales on GitHub (Jan 15, 2025).

Description

In version 1.22.6, I was able to download a file using the API endpoints:

  • /repos/{owner}/{repo}/raw/{filepath}?branch
  • /repos/{owner}/{repo}/raw/{filepath}

However, in version 1.23.0, while the endpoint /repos/{owner}/{repo}/raw/{filepath} still works, the endpoint /repos/{owner}/{repo}/raw/{filepath}?branch returns a 404 error, even though the branch exists.

Gitea Version

1.23.0

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

downloads (the bug happens in https://demo.gitea.com/ too)
systemd (RHEL8)

Database

MySQL/MariaDB

Originally created by @snogales on GitHub (Jan 15, 2025). ### Description In version 1.22.6, I was able to download a file using the API endpoints: - /repos/{owner}/{repo}/raw/{filepath}?branch - /repos/{owner}/{repo}/raw/{filepath} However, in version 1.23.0, while the endpoint /repos/{owner}/{repo}/raw/{filepath} still works, the endpoint /repos/{owner}/{repo}/raw/{filepath}?branch returns a 404 error, even though the branch exists. ### Gitea Version 1.23.0 ### Can you reproduce the bug on the Gitea demo site? Yes ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version _No response_ ### Operating System _No response_ ### How are you running Gitea? downloads (the bug happens in https://demo.gitea.com/ too) systemd (RHEL8) ### Database MySQL/MariaDB
GiteaMirror added the topic/apiissue/needs-feedbacktype/bug labels 2025-11-02 10:59:40 -06:00
Author
Owner

@lunny commented on GitHub (Jan 15, 2025):

I don't think /repos/{owner}/{repo}/raw/{filepath}?branch works maybe it should be /repos/{owner}/{repo}/raw/{filepath}?ref=xxx? It seems there is no real changes in related code in latest release.

@lunny commented on GitHub (Jan 15, 2025): I don't think `/repos/{owner}/{repo}/raw/{filepath}?branch` works maybe it should be `/repos/{owner}/{repo}/raw/{filepath}?ref=xxx`? It seems there is no real changes in related code in latest release.
Author
Owner

@snogales commented on GitHub (Jan 16, 2025):

sorry, my bad. Of course, I meant /repos/{owner}/{repo}/raw/{filepath}?ref=xxx.
I use a program since ages to download a file from a gitea server. The program is not working with gitea 1.23.0, but in 1.22.6 works. The behaviour can be reproduced in the gitea demo site.

@snogales commented on GitHub (Jan 16, 2025): sorry, my bad. Of course, I meant /repos/{owner}/{repo}/raw/{filepath}?ref=xxx. I use a program since ages to download a file from a gitea server. The program is not working with gitea 1.23.0, but in 1.22.6 works. The behaviour can be reproduced in the gitea demo site.
Author
Owner

@yp05327 commented on GitHub (Jan 16, 2025):

I can confirm this issue in gitea.com
If the ref name is branch/tag, it will be 404. Only SHA works well.

@yp05327 commented on GitHub (Jan 16, 2025): I can confirm this issue in gitea.com If the ref name is branch/tag, it will be 404. Only SHA works well.
Author
Owner

@wxiaoguang commented on GitHub (Jan 16, 2025):

I think you mean ?ref=branch

It has been fixed in 1.23.1

@wxiaoguang commented on GitHub (Jan 16, 2025): I think you mean `?ref=branch` It has been fixed in 1.23.1 * #33164
Author
Owner

@snogales commented on GitHub (Jan 16, 2025):

I did not find this issue, thank you

@snogales commented on GitHub (Jan 16, 2025): I did not find this issue, thank you
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#13999