]> Sergey Matveev's repositories - tofuproxy.git/blobdiff - tls.go
More Fprintf usage
[tofuproxy.git] / tls.go
diff --git a/tls.go b/tls.go
index b86f4bf3d5693f3d1f43492fb6c79b6bd9fdce0a..ef43964c83eb4b475c90b3602e1b775ab00142a4 100644 (file)
--- a/tls.go
+++ b/tls.go
@@ -53,11 +53,10 @@ func (h *Handler) ServeHTTP(w http.ResponseWriter, req *http.Request) {
                log.Fatalln(err)
        }
        defer conn.Close()
-       conn.Write([]byte(fmt.Sprintf(
-               "%s %d %s\r\n\r\n",
-               req.Proto,
-               http.StatusOK, http.StatusText(http.StatusOK),
-       )))
+       fmt.Fprintf(
+               conn, "%s %d %s\r\n\r\n",
+               req.Proto, http.StatusOK, http.StatusText(http.StatusOK),
+       )
        host, _, _ := ttls.SplitHostPort(req.Host)
        hostCertsM.Lock()
        keypair, ok := hostCerts[host]