mirror of
https://github.com/tailscale/tailscale.git
synced 2025-08-22 11:01:54 +00:00
tsweb: fix Port80Handler redirect to https with FQDN unset
Fixes the current http://pkgs.tailscale.com/ redirect to https:/// as that server doesn't configure the Port80Handler.FQDN field. Change-Id: Iff56e6127a46c306ca97738d91b217bcab32a582 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:

committed by
Brad Fitzpatrick

parent
c6ac82e3a6
commit
0df3b76c25
@@ -162,7 +162,7 @@ func (h Port80Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
host := h.FQDN
|
||||
if host == "" {
|
||||
host = r.URL.Hostname()
|
||||
host = r.Host
|
||||
}
|
||||
target := "https://" + host + path
|
||||
http.Redirect(w, r, target, http.StatusFound)
|
||||
|
Reference in New Issue
Block a user