mirror of
https://codeberg.org/Codeberg/pages-server.git
synced 2025-04-25 06:16:58 +00:00
use more path.Join()
This commit is contained in:
parent
06b6875f95
commit
2ee530394e
1 changed files with 2 additions and 2 deletions
|
@ -82,7 +82,7 @@ func (o *Options) Upstream(ctx *fasthttp.RequestCtx, giteaRoot, giteaAPIToken st
|
||||||
log.Debug().Msg("preparations")
|
log.Debug().Msg("preparations")
|
||||||
|
|
||||||
// Make a GET request to the upstream URL
|
// Make a GET request to the upstream URL
|
||||||
uri := o.TargetOwner + "/" + o.TargetRepo + "/raw/" + o.TargetBranch + "/" + o.TargetPath
|
uri := path.Join(o.TargetOwner, o.TargetRepo, "raw", o.TargetBranch, o.TargetPath)
|
||||||
var req *fasthttp.Request
|
var req *fasthttp.Request
|
||||||
var res *fasthttp.Response
|
var res *fasthttp.Response
|
||||||
var cachedResponse fileResponse
|
var cachedResponse fileResponse
|
||||||
|
@ -91,7 +91,7 @@ func (o *Options) Upstream(ctx *fasthttp.RequestCtx, giteaRoot, giteaAPIToken st
|
||||||
cachedResponse = cachedValue.(fileResponse)
|
cachedResponse = cachedValue.(fileResponse)
|
||||||
} else {
|
} else {
|
||||||
req = fasthttp.AcquireRequest()
|
req = fasthttp.AcquireRequest()
|
||||||
req.SetRequestURI(giteaRoot + giteaApiRepos + uri)
|
req.SetRequestURI(path.Join(giteaRoot, giteaApiRepos, uri))
|
||||||
req.Header.Set(fasthttp.HeaderAuthorization, giteaAPIToken)
|
req.Header.Set(fasthttp.HeaderAuthorization, giteaAPIToken)
|
||||||
res = fasthttp.AcquireResponse()
|
res = fasthttp.AcquireResponse()
|
||||||
res.SetBodyStream(&strings.Reader{}, -1)
|
res.SetBodyStream(&strings.Reader{}, -1)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue