Merge branch 'main' into issue-163

This commit is contained in:
6543 2023-03-30 21:39:17 +00:00
commit 3178258af9
11 changed files with 235 additions and 21 deletions

View file

@ -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)
}
}