From f7814279447caec80a1b8b93ba5ff41992281026 Mon Sep 17 00:00:00 2001 From: sp Date: Fri, 26 Feb 2021 00:37:57 +1100 Subject: [PATCH] default catch up all answer is renamed to DumpRequest. Also trim space for http dump --- apiv1.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/apiv1.go b/apiv1.go index 47d3f60..460cfb4 100644 --- a/apiv1.go +++ b/apiv1.go @@ -49,7 +49,7 @@ func apiV1Main(w http.ResponseWriter, r *http.Request) { } } //Catch for all - apiV1Error(w, r) + apiV1DumpRequest(w, r) } func apiV1Login(w http.ResponseWriter, r *http.Request) { @@ -69,12 +69,13 @@ func apiSendJson(p interface{}, w http.ResponseWriter) { if e == nil { fmt.Fprint(w, string(b)) } else { - apiV1Error(w, nil) + apiV1DumpRequest(w, nil) } } -func apiV1Error(w http.ResponseWriter, r *http.Request) { +func apiV1DumpRequest(w http.ResponseWriter, r *http.Request) { dump := logRequestDebug(httputil.DumpRequest(r, true)) + dump = strings.TrimSpace(dump) msg := fmt.Sprintf("Unhandled Protocol = %s path= %s", r.Method, r.URL.Path) dumpLines := strings.Split(dump, "\r\n") ar := apiV1ResponseBlank()