What is a CNAME?

This commit is contained in:
2024-01-06 21:26:09 +01:00
parent 6f9f92e68a
commit e628ec7ecf
2 changed files with 8 additions and 8 deletions

View File

@@ -26,8 +26,10 @@ import (
func handleSubdomain(domain, cname, path, giteaUrl, defaultCsp string, giteaClient *repo.GiteaClient, w http.ResponseWriter) {
username := ""
if cname != "" {
// If we are accessed via a CNAME, then CNAME contains our <user>.<pages domain> value.
username = strings.Split(cname, ".")[0]
} else {
// If we are directly accessed, then domain contains our <user>.<pages domain> value.
username = strings.Split(domain, ".")[0]
}