From fda754266e6deb51d737303a438c8a0d0a41a563 Mon Sep 17 00:00:00 2001 From: Ivan Ilves Date: Thu, 6 Feb 2020 16:15:44 +0100 Subject: [PATCH] feat(client): Trace request headers as well as response headers --- api/v1/registry/client/request/request.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/api/v1/registry/client/request/request.go b/api/v1/registry/client/request/request.go index 4f7af35..af4c7fd 100644 --- a/api/v1/registry/client/request/request.go +++ b/api/v1/registry/client/request/request.go @@ -57,8 +57,11 @@ func perform(url, auth, mode string, trace bool) (resp *http.Response, err error if trace { fmt.Printf("%s|@URL: %s\n", rid, url) + for k, v := range req.Header { + fmt.Printf("%s|@REQ-HEADER: %-40s = %s\n", rid, k, v) + } for k, v := range resp.Header { - fmt.Printf("%s|@HEADER: %-40s = %s\n", rid, k, v) + fmt.Printf("%s|@RESP-HEADER: %-40s = %s\n", rid, k, v) } fmt.Printf("%s|--- BODY BEGIN ---\n", rid) for _, line := range strings.Split(getResponseBody(resp), "\n") {