From a05ab9f3bcd9aff4ffd42ef0d38a3f765b7068f9 Mon Sep 17 00:00:00 2001 From: Will Norris Date: Fri, 3 Nov 2023 14:46:53 -0700 Subject: [PATCH] client/web: check r.Host rather than r.URL.Host r.URL.Host is not typically populated on server requests. Updates tailscale/corp#14335 Signed-off-by: Will Norris --- client/web/web.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/web/web.go b/client/web/web.go index 518bc151c..e5f754a4e 100644 --- a/client/web/web.go +++ b/client/web/web.go @@ -261,7 +261,7 @@ func (s *Server) requireTailscaleIP(w http.ResponseWriter, r *http.Request) (han ipv6ServiceHost = "[" + tsaddr.TailscaleServiceIPv6String + "]" ) // allow requests on quad-100 (or ipv6 equivalent) - if r.URL.Host == ipv4ServiceHost || r.URL.Host == ipv6ServiceHost { + if r.Host == ipv4ServiceHost || r.Host == ipv6ServiceHost { return false }