From 5db0804f1db1de342b2e351f8aeff96b85b4e51f Mon Sep 17 00:00:00 2001 From: William Perron Date: Wed, 8 Nov 2023 15:03:30 -0500 Subject: [PATCH] fmt improvements --- cmd/httpcat/main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/httpcat/main.go b/cmd/httpcat/main.go index e44cf82..cc4adad 100644 --- a/cmd/httpcat/main.go +++ b/cmd/httpcat/main.go @@ -20,9 +20,9 @@ var _ http.Handler = &CatHandler{} func (cs *CatHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) { log.Printf("[%s] %s %s", req.Host, req.Method, req.URL.Path) - w.Write([]byte(fmt.Sprintf("HTTP1.1 %s %s\n", req.Method, req.URL.Path))) + w.Write([]byte(fmt.Sprintf("%s %s %s\n", req.Proto, req.Method, req.URL.Path))) for k, v := range req.Header { - w.Write([]byte(fmt.Sprintf("%s: %s\n", k, strings.Join(v, ", ")))) + w.Write([]byte(fmt.Sprintf("%s: %s\n", k, strings.Join(v, "; ")))) } w.Write([]byte{'\n'})