From c8b63a409e031baba04d37a16f8d99a5e3b9f6b5 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Tue, 4 Jan 2022 19:22:36 -0800 Subject: [PATCH] cmd/hello: also redirect https://hello.ipn.dev to hello.ts.net I apparently only did HTTP before, not HTTPS. Updates tailscale/corp#1327 Change-Id: I7d5265a0a25fcab5b142c8c3f21a0920f6cae39f Signed-off-by: Brad Fitzpatrick --- cmd/hello/hello.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/hello/hello.go b/cmd/hello/hello.go index 018fd9b7a..97b98be32 100644 --- a/cmd/hello/hello.go +++ b/cmd/hello/hello.go @@ -161,6 +161,10 @@ func root(w http.ResponseWriter, r *http.Request) { http.Redirect(w, r, "/", http.StatusFound) return } + if r.TLS != nil && *httpsAddr != "" && strings.Contains(r.Host, "hello.ipn.dev") { + http.Redirect(w, r, "https://hello.ts.net", http.StatusFound) + return + } tmpl, err := getTmpl() if err != nil { w.Header().Set("Content-Type", "text/plain")