Make --dump-bodies imply --dump-headers
This commit is contained in:
parent
c117eaf5a2
commit
f2eeb4301c
1 changed files with 2 additions and 2 deletions
|
@ -144,7 +144,7 @@ func (t *Transport) RoundTrip(req *http.Request) (resp *http.Response, err error
|
||||||
// Force user agent
|
// Force user agent
|
||||||
req.Header.Set("User-Agent", UserAgent)
|
req.Header.Set("User-Agent", UserAgent)
|
||||||
// Log request
|
// Log request
|
||||||
if t.logHeader {
|
if t.logHeader || t.logBody {
|
||||||
buf, _ := httputil.DumpRequestOut(req, t.logBody)
|
buf, _ := httputil.DumpRequestOut(req, t.logBody)
|
||||||
Debug(nil, "%s", separatorReq)
|
Debug(nil, "%s", separatorReq)
|
||||||
Debug(nil, "%s", "HTTP REQUEST")
|
Debug(nil, "%s", "HTTP REQUEST")
|
||||||
|
@ -154,7 +154,7 @@ func (t *Transport) RoundTrip(req *http.Request) (resp *http.Response, err error
|
||||||
// Do round trip
|
// Do round trip
|
||||||
resp, err = t.Transport.RoundTrip(req)
|
resp, err = t.Transport.RoundTrip(req)
|
||||||
// Log response
|
// Log response
|
||||||
if t.logHeader {
|
if t.logHeader || t.logBody {
|
||||||
Debug(nil, "%s", separatorResp)
|
Debug(nil, "%s", separatorResp)
|
||||||
Debug(nil, "%s", "HTTP RESPONSE")
|
Debug(nil, "%s", "HTTP RESPONSE")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in a new issue