API raw route should support tags/branches #5642

Closed
opened 2025-11-02 06:31:42 -06:00 by GiteaMirror · 5 comments
Owner

Originally created by @brandonkal on GitHub (Jun 27, 2020).

  • Gitea version (or commit ref): master

Description

/repos/{owner}/{repo}/raw/{filepath} only supports the master branch. It should also support specifying branch and tag.

As far as I can tell, I have to use the /repos/{owner}/{repo}/contents/{filepath} route and then decode the base64 contents.

For my specific use case, I would also like to see the raw download url accept Authorization token headers.

Originally created by @brandonkal on GitHub (Jun 27, 2020). - Gitea version (or commit ref): master ## Description /repos/{owner}/{repo}/raw/{filepath} only supports the master branch. It should also support specifying branch and tag. As far as I can tell, I have to use the /repos/{owner}/{repo}/contents/{filepath} route and then decode the base64 contents. For my specific use case, I would also like to see the raw download url accept Authorization token headers.
GiteaMirror added the type/enhancementmodifies/api labels 2025-11-02 06:31:42 -06:00
Author
Owner

@stale[bot] commented on GitHub (Aug 29, 2020):

This issue has been automatically marked as stale because it has not had recent activity. I am here to help clear issues left open even if solved or waiting for more insight. This issue will be closed if no further activity occurs during the next 2 weeks. If the issue is still valid just add a comment to keep it alive. Thank you for your contributions.

@stale[bot] commented on GitHub (Aug 29, 2020): This issue has been automatically marked as stale because it has not had recent activity. I am here to help clear issues left open even if solved or waiting for more insight. This issue will be closed if no further activity occurs during the next 2 weeks. If the issue is still valid just add a comment to keep it alive. Thank you for your contributions.
Author
Owner

@zeripath commented on GitHub (Aug 29, 2020):

Why can't you use the ?ref= parameter.

@zeripath commented on GitHub (Aug 29, 2020): Why can't you use the `?ref=` parameter.
Author
Owner

@neolithos commented on GitHub (Aug 31, 2020):

Because is not mentioned in the swagger help page.

@neolithos commented on GitHub (Aug 31, 2020): Because is not mentioned in the swagger help page.
Author
Owner

@zeripath commented on GitHub (Sep 13, 2020):

Actually I'm wrong the ref Param isn't used on this path. Apologies.

However looking at the code, I think the file path needs to be the same as on the actual site.

That is:

/api/v1/repos/{owner}/{name}/raw/branch/{branch name}/{file path}

And so on for tags and commits

@zeripath commented on GitHub (Sep 13, 2020): Actually I'm wrong the ref Param isn't used on this path. Apologies. However looking at the code, I think the file path needs to be the same as on the actual site. That is: /api/v1/repos/{owner}/{name}/raw/branch/{branch name}/{file path} And so on for tags and commits
Author
Owner

@d-lunyov commented on GitHub (Feb 9, 2021):

Looks like it is duplicate https://github.com/go-gitea/gitea/issues/14597

@d-lunyov commented on GitHub (Feb 9, 2021): Looks like it is duplicate https://github.com/go-gitea/gitea/issues/14597
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#5642