]> Sergey Matveev's repositories - tofuproxy.git/blobdiff - rounds/redirectHTML.go
More Fprintf usage
[tofuproxy.git] / rounds / redirectHTML.go
index abc657e6546a8926d249f5eb0c418c50d32a7698..d139eb28ae41157c5e5bfc50ad4a784d81b10a73 100644 (file)
@@ -82,14 +82,13 @@ func RoundRedirectHTML(
        w.Header().Add("Content-Type", "text/html")
        w.WriteHeader(http.StatusOK)
        location := resp.Header.Get("Location")
-       w.Write([]byte(
-               fmt.Sprintf(
-                       `<!DOCTYPE html>
+       fmt.Fprintf(
+               w, `<!DOCTYPE html>
 <html><head><title>%d %s: %s redirection</title></head>
 <body><a href="%s">%s</a></body></html>`,
-                       resp.StatusCode, http.StatusText(resp.StatusCode),
-                       redirType, location, location,
-               )))
+               resp.StatusCode, http.StatusText(resp.StatusCode),
+               redirType, location, location,
+       )
        fifos.LogRedir <- fmt.Sprintf(
                "%s %s\t%s\t%s", req.Method, req.URL, resp.Status, location,
        )