refactor: finish use default const for defaultPagesBranch and defaultPagesRepo

This commit is contained in:
6543 2022-11-12 21:16:11 +01:00
parent c827a28dd8
commit 4565481643
No known key found for this signature in database
GPG key ID: C99B82E40B027BAE
3 changed files with 3 additions and 4 deletions

View file

@ -24,7 +24,7 @@ func tryUpstream(ctx *context.Context, giteaClient *gitea.Client,
canonicalDomain, _ := options.CheckCanonicalDomain(giteaClient, "", string(mainDomainSuffix), canonicalDomainCache)
if !strings.HasSuffix(strings.SplitN(canonicalDomain, "/", 2)[0], string(mainDomainSuffix)) {
canonicalPath := ctx.Req.RequestURI
if options.TargetRepo != "pages" {
if options.TargetRepo != defaultPagesRepo {
path := strings.SplitN(canonicalPath, "/", 3)
if len(path) >= 3 {
canonicalPath = "/" + path[2]