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

raw file API broken after updating from 1.22.6 to 1.23.0 #33164

Closed
3XC1T3D opened this issue Jan 9, 2025 · 4 comments · Fixed by #33172
Closed

raw file API broken after updating from 1.22.6 to 1.23.0 #33164

3XC1T3D opened this issue Jan 9, 2025 · 4 comments · Fixed by #33172
Assignees
Labels
Milestone

Comments

@3XC1T3D
Copy link

3XC1T3D commented Jan 9, 2025

Description

We updated from Gitea 1.22.6 to 1.23.0. When we try to get a raw file from the repository with ref Parameter , we are getting a 404 response.

You can reproduce it on demo site with following commands.

doesnt work:

curl -X 'GET' \
  'https://demo.gitea.com/api/v1/repos/Zettat123/schedule-actions/raw/README.md?ref=main' \
  -H 'accept: application/octet-stream'

works:

curl -X 'GET' \
  'https://demo.gitea.com/api/v1/repos/Zettat123/schedule-actions/raw/main%2FREADME.md' \
  -H 'accept: application/octet-stream'

?ref=main had to be removed, and is instead added as part of the filepath path parameter

the swagger page still lists the ref parameter, which seems to have been replaced by the ref within the filepath parameter

https://demo.gitea.com/api/swagger#/repository/repoGetRawFile

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?

docker

Database

MySQL/MariaDB

@wxiaoguang wxiaoguang self-assigned this Jan 9, 2025
@wxiaoguang
Copy link
Contributor

wxiaoguang commented Jan 9, 2025

Maybe related to #32413, will take a look

(strange, there are tests covering this case ....)


OK, I see the problem: // For legacy support only full commit sha

@wxiaoguang
Copy link
Contributor

wxiaoguang commented Jan 9, 2025

-> Fix raw file API ref handling #33172

(the old tests are not complete and there are some buggy edge cases ....)

@lunny lunny added this to the 1.23.1 milestone Jan 9, 2025
@lunny lunny closed this as completed in 65aae09 Jan 10, 2025
GiteaBot pushed a commit to GiteaBot/gitea that referenced this issue Jan 10, 2025
wxiaoguang added a commit that referenced this issue Jan 10, 2025
Backport #33172 by wxiaoguang

Fix #33164 and add more tests

Co-authored-by: wxiaoguang <[email protected]>
@wxiaoguang
Copy link
Contributor

1.23 nightly (will be 1.23.1 soon) is ready, it also contains some other fixes to have.

@3XC1T3D
Copy link
Author

3XC1T3D commented Jan 10, 2025

Thank you very much for the fast Bugfix!

We wait, till the new Minor Release 1.23.1 will be released 👍 we have no urge to use the nighlty build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants