Refactor split long functions ()

we have big functions that handle all stuff ... we should split this into smaler chuncks so we could test them seperate and make clear cuts in what happens where

Reviewed-on: https://codeberg.org/Codeberg/pages-server/pulls/135
This commit is contained in:
6543 2022-11-12 20:43:44 +01:00
parent b9966487f6
commit 6c63b66ce4
17 changed files with 547 additions and 427 deletions
server/certificates

View file

@ -78,8 +78,12 @@ func TLSConfig(mainDomainSuffix string,
// DNS not set up, return main certificate to redirect to the docs
sni = mainDomainSuffix
} else {
_, _ = targetRepo, targetBranch
_, valid := upstream.CheckCanonicalDomain(giteaClient, targetOwner, targetRepo, targetBranch, sni, mainDomainSuffix, canonicalDomainCache)
targetOpt := &upstream.Options{
TargetOwner: targetOwner,
TargetRepo: targetRepo,
TargetBranch: targetBranch,
}
_, valid := targetOpt.CheckCanonicalDomain(giteaClient, sni, mainDomainSuffix, canonicalDomainCache)
if !valid {
sni = mainDomainSuffix
}