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

Closed
opened 2025-11-02 10:57:48 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @3XC1T3D on GitHub (Jan 9, 2025).

Originally assigned to: @wxiaoguang on GitHub.

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

Originally created by @3XC1T3D on GitHub (Jan 9, 2025). Originally assigned to: @wxiaoguang on GitHub. ### 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
GiteaMirror added the type/bug label 2025-11-02 10:57:48 -06:00
Author
Owner

@wxiaoguang commented on GitHub (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 commented on GitHub (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`
Author
Owner

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

-> Fix raw file API ref handling #33172

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

@wxiaoguang commented on GitHub (Jan 9, 2025): -> Fix raw file API ref handling #33172 (the old tests are not complete and there are some buggy edge cases ....)
Author
Owner

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

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

@wxiaoguang commented on GitHub (Jan 10, 2025): 1.23 nightly (will be 1.23.1 soon) is ready, it also contains some other fixes to have. * https://dl.gitea.com/gitea/1.23-nightly/ * https://hub.docker.com/r/gitea/gitea/tags?name=1.23-nightly
Author
Owner

@3XC1T3D commented on GitHub (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.

@3XC1T3D commented on GitHub (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 in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#13938