/*
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
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],
)