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 <will@tailscale.com>
This commit is contained in:
Will Norris 2023-11-03 14:46:53 -07:00 committed by Will Norris
parent 6b956b49e0
commit a05ab9f3bc

View File

@ -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
}