Support canonical-domain-file configuration

This commit is contained in:
Max Stanley 2024-02-28 23:14:01 +00:00
parent 557a295732
commit 2410137438
12 changed files with 95 additions and 68 deletions

View file

@ -92,6 +92,7 @@ func Handler(
cfg.MainDomain,
trimmedHost,
pathElements,
cfg.CanonicalDomainFile,
canonicalDomainCache, redirectsCache)
} else if strings.HasSuffix(trimmedHost, cfg.MainDomain) {
log.Debug().Msg("subdomain request detected")
@ -100,6 +101,7 @@ func Handler(
cfg.PagesBranches,
trimmedHost,
pathElements,
cfg.CanonicalDomainFile,
canonicalDomainCache, redirectsCache)
} else {
log.Debug().Msg("custom domain request detected")
@ -108,6 +110,7 @@ func Handler(
trimmedHost,
pathElements,
cfg.PagesBranches[0],
cfg.CanonicalDomainFile,
canonicalDomainCache, redirectsCache)
}
}