Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

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

Nick Craig-Woodf2eeb4301cc0
diff --git a/fs/http.go b/fs/http.go
index 84f1fde24..d59e218ff 100644
--- a/fs/http.go
+++ b/fs/http.go
@@ -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 {