diff --git a/src/082-canonical-hosts/canonical-hosts.go b/src/082-canonical-hosts/canonical-hosts.go index e503088..2a8b2a9 100644 --- a/src/082-canonical-hosts/canonical-hosts.go +++ b/src/082-canonical-hosts/canonical-hosts.go @@ -20,7 +20,7 @@ func wrapCanonicalHost(f handler, chost string) handler { if host != chost { fmt.Println("redirect to", chost) hostPort[0] = chost - url := "http://" + + url := "http://" + strings.Join(hostPort, ":") + r.URL.String() http.Redirect(w, r, url, 301)