diff --git a/cmd/rio/main.go b/cmd/rio/main.go index dfd76fe..339f195 100644 --- a/cmd/rio/main.go +++ b/cmd/rio/main.go @@ -24,8 +24,12 @@ import ( ) func handleSubdomain(domain, cname, path, giteaUrl, defaultCsp string, giteaClient *repo.GiteaClient, w http.ResponseWriter) { - hostParts := strings.Split(domain, ".") - username := hostParts[0] + username := "" + if cname != "" { + username = strings.Split(cname, ".")[0] + } else { + username = strings.Split(domain, ".")[0] + } // Strip the leading / if path[:1] == "/" {