fix: Correctly compute the username from a CNAME
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
parent
996aa10866
commit
6f9f92e68a
@ -24,8 +24,12 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func handleSubdomain(domain, cname, path, giteaUrl, defaultCsp string, giteaClient *repo.GiteaClient, w http.ResponseWriter) {
|
func handleSubdomain(domain, cname, path, giteaUrl, defaultCsp string, giteaClient *repo.GiteaClient, w http.ResponseWriter) {
|
||||||
hostParts := strings.Split(domain, ".")
|
username := ""
|
||||||
username := hostParts[0]
|
if cname != "" {
|
||||||
|
username = strings.Split(cname, ".")[0]
|
||||||
|
} else {
|
||||||
|
username = strings.Split(domain, ".")[0]
|
||||||
|
}
|
||||||
|
|
||||||
// Strip the leading /
|
// Strip the leading /
|
||||||
if path[:1] == "/" {
|
if path[:1] == "/" {
|
||||||
|
Loading…
Reference in New Issue
Block a user