]> Sergey Matveev's repositories - tofuproxy.git/blobdiff - rounds/gemini.go
More Fprintf usage
[tofuproxy.git] / rounds / gemini.go
index b3ed3205f2aabdc974a75407285aba429a4babb2..d81039fd01872a9aabd2627658de1b8fb68a2848 100644 (file)
@@ -1,7 +1,7 @@
 /*
 tofuproxy -- flexible HTTP/HTTPS proxy, TLS terminator, X.509 TOFU
              manager, WARC/geminispace browser
-Copyright (C) 2021 Sergey Matveev <stargrave@stargrave.org>
+Copyright (C) 2021-2023 Sergey Matveev <stargrave@stargrave.org>
 
 This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
@@ -151,13 +151,9 @@ func RoundGemini(
                w.Header().Add("Content-Type", "text/html")
                w.WriteHeader(http.StatusOK)
                u := geminifyURL(host, cols[1], paths...)
-               w.Write([]byte(
-                       fmt.Sprintf(
-                               `<!DOCTYPE html>
+               fmt.Fprintf(w, `<!DOCTYPE html>
 <html><head><title>%d (%s) redirection</title></head>
-<body>Redirection to <a href="%s">%s</a></body></html>`,
-                               code, codeName, u, u,
-                       )))
+<body><a href="%s">%s</a></body></html>`, code, codeName, u, u)
                fifos.LogRedir <- fmt.Sprintf(
                        "%s %s\t%d\t%s", req.Method, req.URL, code, cols[1],
                )