diff --git a/server/dns/dns.go b/server/dns/dns.go index 757afc1..c11b278 100644 --- a/server/dns/dns.go +++ b/server/dns/dns.go @@ -11,6 +11,8 @@ import ( // lookupCacheTimeout specifies the timeout for the DNS lookup cache. var lookupCacheTimeout = 15 * time.Minute +var defaultPagesRepo = "pages" + // GetTargetFromDNS searches for CNAME or TXT entries on the request domain ending with MainDomainSuffix. // If everything is fine, it returns the target data. func GetTargetFromDNS(domain, mainDomainSuffix, firstDefaultBranch string, dnsLookupCache cache.SetGetKey) (targetOwner, targetRepo, targetBranch string) { @@ -50,9 +52,9 @@ func GetTargetFromDNS(domain, mainDomainSuffix, firstDefaultBranch string, dnsLo targetBranch = cnameParts[len(cnameParts)-3] } if targetRepo == "" { - targetRepo = firstDefaultBranch + targetRepo = defaultPagesRepo } - if targetBranch == "" && targetRepo != firstDefaultBranch { + if targetBranch == "" && targetRepo != defaultPagesRepo { targetBranch = firstDefaultBranch } // if targetBranch is still empty, the caller must find the default branch