Skip to content

Commit

Permalink
Fix logging message when content type is empty (#14737)
Browse files Browse the repository at this point in the history
  • Loading branch information
jhendrixMSFT authored Jun 2, 2021
1 parent e02226f commit 52583c0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sdk/azcore/response.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 52583c0

Please sign in to comment.