Make --dump-bodies imply --dump-headers

This commit is contained in:
Nick Craig-Wood 2016-09-22 08:40:37 +01:00
parent c117eaf5a2
commit f2eeb4301c

View File

@ -144,7 +144,7 @@ func (t *Transport) RoundTrip(req *http.Request) (resp *http.Response, err error
// Force user agent
req.Header.Set("User-Agent", UserAgent)
// Log request
if t.logHeader {
if t.logHeader || t.logBody {
buf, _ := httputil.DumpRequestOut(req, t.logBody)
Debug(nil, "%s", separatorReq)
Debug(nil, "%s", "HTTP REQUEST")
@ -154,7 +154,7 @@ func (t *Transport) RoundTrip(req *http.Request) (resp *http.Response, err error
// Do round trip
resp, err = t.Transport.RoundTrip(req)
// Log response
if t.logHeader {
if t.logHeader || t.logBody {
Debug(nil, "%s", separatorResp)
Debug(nil, "%s", "HTTP RESPONSE")
if err != nil {