mirror of
https://codeberg.org/Codeberg/pages-server.git
synced 2025-04-25 06:16:58 +00:00
fix bug of 8519bba527
This commit is contained in:
parent
5e499fc12c
commit
6afc95b875
1 changed files with 29 additions and 25 deletions
|
@ -105,7 +105,6 @@ func Handler(mainDomainSuffix, rawDomain string,
|
||||||
if len(pathElements) > 2 && strings.HasPrefix(pathElements[2], "@") {
|
if len(pathElements) > 2 && strings.HasPrefix(pathElements[2], "@") {
|
||||||
log.Debug().Msg("raw domain preparations, now trying with specified branch")
|
log.Debug().Msg("raw domain preparations, now trying with specified branch")
|
||||||
if targetOpt, works := tryBranch(log, ctx, giteaClient, &upstream.Options{
|
if targetOpt, works := tryBranch(log, ctx, giteaClient, &upstream.Options{
|
||||||
TryIndexPages: false,
|
|
||||||
ServeRaw: true,
|
ServeRaw: true,
|
||||||
TargetOwner: pathElements[0],
|
TargetOwner: pathElements[0],
|
||||||
TargetRepo: pathElements[1],
|
TargetRepo: pathElements[1],
|
||||||
|
@ -162,6 +161,7 @@ func Handler(mainDomainSuffix, rawDomain string,
|
||||||
|
|
||||||
log.Debug().Msg("main domain preparations, now trying with specified repo & branch")
|
log.Debug().Msg("main domain preparations, now trying with specified repo & branch")
|
||||||
if targetOpt, works := tryBranch(log, ctx, giteaClient, &upstream.Options{
|
if targetOpt, works := tryBranch(log, ctx, giteaClient, &upstream.Options{
|
||||||
|
TryIndexPages: true,
|
||||||
TargetOwner: targetOwner,
|
TargetOwner: targetOwner,
|
||||||
TargetRepo: pathElements[0],
|
TargetRepo: pathElements[0],
|
||||||
TargetBranch: pathElements[1][1:],
|
TargetBranch: pathElements[1][1:],
|
||||||
|
@ -182,6 +182,7 @@ func Handler(mainDomainSuffix, rawDomain string,
|
||||||
if strings.HasPrefix(pathElements[0], "@") {
|
if strings.HasPrefix(pathElements[0], "@") {
|
||||||
log.Debug().Msg("main domain preparations, now trying with specified branch")
|
log.Debug().Msg("main domain preparations, now trying with specified branch")
|
||||||
if targetOpt, works := tryBranch(log, ctx, giteaClient, &upstream.Options{
|
if targetOpt, works := tryBranch(log, ctx, giteaClient, &upstream.Options{
|
||||||
|
TryIndexPages: true,
|
||||||
TargetOwner: targetOwner,
|
TargetOwner: targetOwner,
|
||||||
TargetRepo: "pages",
|
TargetRepo: "pages",
|
||||||
TargetBranch: pathElements[0][1:],
|
TargetBranch: pathElements[0][1:],
|
||||||
|
@ -203,6 +204,7 @@ func Handler(mainDomainSuffix, rawDomain string,
|
||||||
log.Debug().Msg("main domain preparations, now trying with specified repo")
|
log.Debug().Msg("main domain preparations, now trying with specified repo")
|
||||||
if pathElements[0] != "pages" {
|
if pathElements[0] != "pages" {
|
||||||
if targetOpt, works := tryBranch(log, ctx, giteaClient, &upstream.Options{
|
if targetOpt, works := tryBranch(log, ctx, giteaClient, &upstream.Options{
|
||||||
|
TryIndexPages: true,
|
||||||
TargetOwner: targetOwner,
|
TargetOwner: targetOwner,
|
||||||
TargetRepo: pathElements[0],
|
TargetRepo: pathElements[0],
|
||||||
TargetBranch: "pages",
|
TargetBranch: "pages",
|
||||||
|
@ -218,6 +220,7 @@ func Handler(mainDomainSuffix, rawDomain string,
|
||||||
// example.codeberg.page/index.html
|
// example.codeberg.page/index.html
|
||||||
log.Debug().Msg("main domain preparations, now trying with default repo/branch")
|
log.Debug().Msg("main domain preparations, now trying with default repo/branch")
|
||||||
if targetOpt, works := tryBranch(log, ctx, giteaClient, &upstream.Options{
|
if targetOpt, works := tryBranch(log, ctx, giteaClient, &upstream.Options{
|
||||||
|
TryIndexPages: true,
|
||||||
TargetOwner: targetOwner,
|
TargetOwner: targetOwner,
|
||||||
TargetRepo: "pages",
|
TargetRepo: "pages",
|
||||||
TargetPath: path.Join(pathElements...),
|
TargetPath: path.Join(pathElements...),
|
||||||
|
@ -255,6 +258,7 @@ func Handler(mainDomainSuffix, rawDomain string,
|
||||||
// Try to use the given repo on the given branch or the default branch
|
// Try to use the given repo on the given branch or the default branch
|
||||||
log.Debug().Msg("custom domain preparations, now trying with details from DNS")
|
log.Debug().Msg("custom domain preparations, now trying with details from DNS")
|
||||||
if targetOpt, works := tryBranch(log, ctx, giteaClient, &upstream.Options{
|
if targetOpt, works := tryBranch(log, ctx, giteaClient, &upstream.Options{
|
||||||
|
TryIndexPages: true,
|
||||||
TargetOwner: targetOwner,
|
TargetOwner: targetOwner,
|
||||||
TargetRepo: targetRepo,
|
TargetRepo: targetRepo,
|
||||||
TargetBranch: targetBranch,
|
TargetBranch: targetBranch,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue