diff --git a/sdk/azcore/response.go b/sdk/azcore/response.go index d46229acb6af..a9d60e439174 100644 --- a/sdk/azcore/response.go +++ b/sdk/azcore/response.go @@ -137,7 +137,11 @@ func (r *Response) retryAfter() time.Duration { // writes to a buffer, used for logging purposes func (r *Response) writeBody(b *bytes.Buffer) error { - if ct := r.Header.Get(HeaderContentType); !shouldLogBody(b, ct) { + ct := r.Header.Get(HeaderContentType) + if ct == "" { + fmt.Fprint(b, " Response contained no body\n") + return nil + } else if !shouldLogBody(b, ct) { return nil } body, err := r.Payload()