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
8c8128ee4b
37 changed files with 1712 additions and 760 deletions
|
@ -17,7 +17,6 @@ const (
|
|||
headerAccessControlAllowOrigin = "Access-Control-Allow-Origin"
|
||||
headerAccessControlAllowMethods = "Access-Control-Allow-Methods"
|
||||
defaultPagesRepo = "pages"
|
||||
defaultPagesBranch = "pages"
|
||||
)
|
||||
|
||||
// Handler handles a single HTTP request to the web server.
|
||||
|
@ -25,7 +24,8 @@ func Handler(mainDomainSuffix, rawDomain string,
|
|||
giteaClient *gitea.Client,
|
||||
rawInfoPage string,
|
||||
blacklistedPaths, allowedCorsDomains []string,
|
||||
dnsLookupCache, canonicalDomainCache, authCache cache.SetGetKey,
|
||||
defaultPagesBranches []string,
|
||||
dnsLookupCache, canonicalDomainCache cache.SetGetKey,
|
||||
) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, req *http.Request) {
|
||||
log := log.With().Strs("Handler", []string{req.Host, req.RequestURI}).Logger()
|
||||
|
@ -110,6 +110,7 @@ func Handler(mainDomainSuffix, rawDomain string,
|
|||
log.Debug().Msg("subdomain request detecded")
|
||||
handleSubDomain(log, ctx, giteaClient,
|
||||
mainDomainSuffix,
|
||||
defaultPagesBranches,
|
||||
trimmedHost,
|
||||
pathElements,
|
||||
canonicalDomainCache)
|
||||
|
@ -119,6 +120,7 @@ func Handler(mainDomainSuffix, rawDomain string,
|
|||
mainDomainSuffix,
|
||||
trimmedHost,
|
||||
pathElements,
|
||||
defaultPagesBranches[0],
|
||||
dnsLookupCache, canonicalDomainCache)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue