mirror of
https://codeberg.org/Codeberg/pages-server.git
synced 2025-04-24 22:06:57 +00:00
Merge branch 'main' into issue-163
This commit is contained in:
commit
3178258af9
11 changed files with 235 additions and 21 deletions
|
@ -25,7 +25,7 @@ func Handler(mainDomainSuffix, rawDomain string,
|
|||
rawInfoPage string,
|
||||
blacklistedPaths, allowedCorsDomains []string,
|
||||
defaultPagesBranches []string,
|
||||
dnsLookupCache, canonicalDomainCache cache.SetGetKey,
|
||||
dnsLookupCache, canonicalDomainCache, redirectsCache cache.SetGetKey,
|
||||
) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, req *http.Request) {
|
||||
log := log.With().Strs("Handler", []string{req.Host, req.RequestURI}).Logger()
|
||||
|
@ -105,7 +105,7 @@ func Handler(mainDomainSuffix, rawDomain string,
|
|||
mainDomainSuffix, rawInfoPage,
|
||||
trimmedHost,
|
||||
pathElements,
|
||||
canonicalDomainCache)
|
||||
canonicalDomainCache, redirectsCache)
|
||||
} else if strings.HasSuffix(trimmedHost, mainDomainSuffix) {
|
||||
log.Debug().Msg("subdomain request detecded")
|
||||
handleSubDomain(log, ctx, giteaClient,
|
||||
|
@ -113,7 +113,7 @@ func Handler(mainDomainSuffix, rawDomain string,
|
|||
defaultPagesBranches,
|
||||
trimmedHost,
|
||||
pathElements,
|
||||
canonicalDomainCache)
|
||||
canonicalDomainCache, redirectsCache)
|
||||
} else {
|
||||
log.Debug().Msg("custom domain request detecded")
|
||||
handleCustomDomain(log, ctx, giteaClient,
|
||||
|
@ -121,7 +121,7 @@ func Handler(mainDomainSuffix, rawDomain string,
|
|||
trimmedHost,
|
||||
pathElements,
|
||||
defaultPagesBranches[0],
|
||||
dnsLookupCache, canonicalDomainCache)
|
||||
dnsLookupCache, canonicalDomainCache, redirectsCache)
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue