cmd/serve: don't convert localhost to 127.0.0.1

This is not valid in many situations, specifically when running a local astro site that listens on localhost, but ignores 127.0.0.1

Fixes: https://github.com/tailscale/tailscale/issues/12201

Signed-off-by: Josh McKinney <joshka@users.noreply.github.com>
This commit is contained in:
Josh McKinney
2024-05-20 17:38:08 -07:00
committed by Brad Fitzpatrick
parent 210264f942
commit 1d6ab9f9db
2 changed files with 6 additions and 7 deletions
+1 -1
View File
@@ -538,7 +538,7 @@ func ExpandProxyTargetValue(target string, supportedSchemes []string, defaultSch
return "", fmt.Errorf("invalid port %q", u.Port())
}
u.Host = fmt.Sprintf("%s:%d", host, port)
u.Host = fmt.Sprintf("%s:%d", u.Hostname(), port)
return u.String(), nil
}