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'})