Skip to content

API raw route should support tags/branches #12066

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

Closed
brandonkal opened this issue Jun 27, 2020 · 5 comments
Closed

API raw route should support tags/branches #12066

brandonkal opened this issue Jun 27, 2020 · 5 comments
Labels
modifies/api This PR adds API routes or modifies them type/enhancement An improvement of existing functionality

Comments

@brandonkal
Copy link

  • 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.

@stale
Copy link

stale bot commented 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 stale bot added the issue/stale label Aug 29, 2020
@zeripath
Copy link
Contributor

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

@stale stale bot removed the issue/stale label Aug 29, 2020
@neolithos
Copy link

Because is not mentioned in the swagger help page.

@zeripath
Copy link
Contributor

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

@6543 6543 added modifies/api This PR adds API routes or modifies them type/enhancement An improvement of existing functionality labels Oct 13, 2020
@d-lunyov
Copy link

d-lunyov commented Feb 9, 2021

Looks like it is duplicate #14597

@6543 6543 closed this as completed Feb 9, 2021
@go-gitea go-gitea locked and limited conversation to collaborators May 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
modifies/api This PR adds API routes or modifies them type/enhancement An improvement of existing functionality
Projects
None yet
Development

No branches or pull requests

5 participants