mirror of
https://codeberg.org/Codeberg/pages-server.git
synced 2025-04-24 13:56:57 +00:00
rename const
This commit is contained in:
parent
2ee530394e
commit
041a1e11b9
4 changed files with 5 additions and 5 deletions
|
@ -22,4 +22,4 @@ var canonicalDomainCacheTimeout = 15 * time.Minute
|
|||
|
||||
const canonicalDomainConfig = ".domains"
|
||||
|
||||
const giteaApiRepos = "/api/v1/repos/"
|
||||
const giteaAPIRepos = "/api/v1/repos/"
|
||||
|
|
|
@ -20,7 +20,7 @@ func CheckCanonicalDomain(targetOwner, targetRepo, targetBranch, actualDomain, m
|
|||
func giteaRawContent(targetOwner, targetRepo, ref, giteaRoot, giteaAPIToken, resource string) ([]byte, error) {
|
||||
req := fasthttp.AcquireRequest()
|
||||
|
||||
req.SetRequestURI(path.Join(giteaRoot, giteaApiRepos, targetOwner, targetRepo, "raw", resource+"?ref="+url.QueryEscape(ref)))
|
||||
req.SetRequestURI(path.Join(giteaRoot, giteaAPIRepos, targetOwner, targetRepo, "raw", resource+"?ref="+url.QueryEscape(ref)))
|
||||
req.Header.Set(fasthttp.HeaderAuthorization, giteaAPIToken)
|
||||
res := fasthttp.AcquireResponse()
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@ func giteaGetRepoBranchTimestamp(giteaRoot, repoOwner, repoName, branchName, git
|
|||
client := getFastHTTPClient(5 * time.Second)
|
||||
|
||||
req := fasthttp.AcquireRequest()
|
||||
req.SetRequestURI(path.Join(giteaRoot, giteaApiRepos, repoOwner, repoName, "branches", branchName))
|
||||
req.SetRequestURI(path.Join(giteaRoot, giteaAPIRepos, repoOwner, repoName, "branches", branchName))
|
||||
req.Header.Set(fasthttp.HeaderAuthorization, giteaAPIToken)
|
||||
res := fasthttp.AcquireResponse()
|
||||
|
||||
|
@ -68,7 +68,7 @@ func giteaGetRepoDefaultBranch(giteaRoot, repoOwner, repoName, giteaAPIToken str
|
|||
client := getFastHTTPClient(5 * time.Second)
|
||||
|
||||
req := fasthttp.AcquireRequest()
|
||||
req.SetRequestURI(path.Join(giteaRoot, giteaApiRepos, repoOwner, repoName))
|
||||
req.SetRequestURI(path.Join(giteaRoot, giteaAPIRepos, repoOwner, repoName))
|
||||
req.Header.Set(fasthttp.HeaderAuthorization, giteaAPIToken)
|
||||
res := fasthttp.AcquireResponse()
|
||||
|
||||
|
|
|
@ -91,7 +91,7 @@ func (o *Options) Upstream(ctx *fasthttp.RequestCtx, giteaRoot, giteaAPIToken st
|
|||
cachedResponse = cachedValue.(fileResponse)
|
||||
} else {
|
||||
req = fasthttp.AcquireRequest()
|
||||
req.SetRequestURI(path.Join(giteaRoot, giteaApiRepos, uri))
|
||||
req.SetRequestURI(path.Join(giteaRoot, giteaAPIRepos, uri))
|
||||
req.Header.Set(fasthttp.HeaderAuthorization, giteaAPIToken)
|
||||
res = fasthttp.AcquireResponse()
|
||||
res.SetBodyStream(&strings.Reader{}, -1)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue