mirror of
https://github.com/juanfont/headscale.git
synced 2025-11-25 03:46:06 -05:00
Fix Domain() to return BaseDomain instead of ServerURL hostname
Co-authored-by: kradalby <98431+kradalby@users.noreply.github.com>
This commit is contained in:
@@ -246,15 +246,11 @@ func validatePKCEMethod(method string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Domain returns the hostname/domain part of the ServerURL.
|
||||
// If the ServerURL is not a valid URL, it returns the BaseDomain.
|
||||
// Domain returns the base domain for the tailnet.
|
||||
// This is the domain used for MagicDNS and displayed in Tailscale clients
|
||||
// as the network name.
|
||||
func (c *Config) Domain() string {
|
||||
u, err := url.Parse(c.ServerURL)
|
||||
if err != nil {
|
||||
return c.BaseDomain
|
||||
}
|
||||
|
||||
return u.Hostname()
|
||||
return c.BaseDomain
|
||||
}
|
||||
|
||||
// LoadConfig prepares and loads the Headscale configuration into Viper.
|
||||
|
||||
Reference in New Issue
Block a user