ipn/ipnlocal: use MagicDNSName of the current profile instead of generating a full ipnstate.Status

Both are populated from the current netmap's MagicDNSSuffix.
But building a full ipnstate.Status (with peers!) is expensive and unnecessary.

Updates #cleanup

Signed-off-by: Nick Khyl <nickk@tailscale.com>
This commit is contained in:
Nick Khyl 2025-04-18 16:52:55 -05:00 committed by Nick Khyl
parent e649227ef2
commit 7090f7fffc

View File

@ -632,7 +632,7 @@ func (b *LocalBackend) getServeHandler(r *http.Request) (_ ipn.HTTPHandlerView,
hostname := r.Host
if r.TLS == nil {
tcd := "." + b.Status().CurrentTailnet.MagicDNSSuffix
tcd := "." + b.CurrentProfile().NetworkProfile().MagicDNSName
if host, _, err := net.SplitHostPort(hostname); err == nil {
hostname = host
}