Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
snogales opened this issue Jan 15, 2025 · 5 comments
Labels
issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail topic/api Concerns mainly the API type/bug

Comments

@snogales
Copy link

snogales commented 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

@lunny
Copy link
Member

lunny commented 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.

@snogales
Copy link
Author

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.

@yp05327
Copy link
Contributor

yp05327 commented 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.

@kemzeb kemzeb added the topic/api Concerns mainly the API label Jan 16, 2025
@wxiaoguang
Copy link
Contributor

wxiaoguang commented Jan 16, 2025

I think you mean ?ref=branch

It has been fixed in 1.23.1

@wxiaoguang wxiaoguang added the issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail label Jan 16, 2025
@snogales
Copy link
Author

I did not find this issue, thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail topic/api Concerns mainly the API type/bug
Projects
None yet
Development

No branches or pull requests

5 participants