refactor: rename domain to root domain

This commit is contained in:
Stavros
2025-09-01 18:19:57 +03:00
parent c80c37ba69
commit 95f8a95fd3
6 changed files with 30 additions and 28 deletions

View File

@@ -12,8 +12,8 @@ import (
"github.com/rs/zerolog"
)
// Get upper domain parses a hostname and returns the upper domain (e.g. sub1.sub2.domain.com -> sub2.domain.com)
func GetUpperDomain(appUrl string) (string, error) {
// Get root domain parses a hostname and returns the upper domain (e.g. sub1.sub2.domain.com -> sub2.domain.com)
func GetRootDomain(appUrl string) (string, error) {
appUrlParsed, err := url.Parse(appUrl)
if err != nil {
return "", err
@@ -88,7 +88,7 @@ func IsRedirectSafe(redirectURL string, domain string) bool {
return false
}
upper, err := GetUpperDomain(redirectURL)
upper, err := GetRootDomain(redirectURL)
if err != nil {
return false