move get raw content from gitea into own func

This commit is contained in:
6543 2021-12-15 05:14:13 +01:00
parent 314cbdb83c
commit 4794318791
No known key found for this signature in database
GPG key ID: C99B82E40B027BAE
4 changed files with 35 additions and 11 deletions

View file

@ -89,7 +89,7 @@ func (o *Options) Upstream(ctx *fasthttp.RequestCtx, giteaRoot, giteaAPIToken st
cachedResponse = cachedValue.(fileResponse)
} else {
req = fasthttp.AcquireRequest()
req.SetRequestURI(giteaRoot + "/api/v1/repos/" + uri + "?access_token=" + giteaAPIToken)
req.SetRequestURI(giteaRoot + giteaApiRepos + uri + "?access_token=" + giteaAPIToken)
res = fasthttp.AcquireResponse()
res.SetBodyStream(&strings.Reader{}, -1)
err = client.Do(req, res)