Skip to content

Commit

Permalink
Merge pull request #159 from drone/fix-response-dump
Browse files Browse the repository at this point in the history
fixed raw response dumping in client
  • Loading branch information
bradrydzewski authored Mar 8, 2022
2 parents 309df22 + 20ea640 commit c229b53
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion scm/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"io"
"net/http"
"net/url"
"os"
"strconv"
"strings"
"sync"
Expand Down Expand Up @@ -167,7 +168,9 @@ func (c *Client) Do(ctx context.Context, in *Request) (*Response, error) {

// dumps the response for debugging purposes.
if c.DumpResponse != nil {
c.DumpResponse(res, true)
if raw, errDump := c.DumpResponse(res, true); errDump == nil {
_, _ = os.Stdout.Write(raw)
}
}
return newResponse(res), nil
}
Expand Down

0 comments on commit c229b53

Please sign in to comment.