Skip to content

Commit

Permalink
Use a local copy of client
Browse files Browse the repository at this point in the history
  • Loading branch information
vbrown608 committed May 7, 2020
1 parent 33e1129 commit c065ece
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions go/porcelain/http/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ func NewRetryableTransport(tr runtime.ClientTransport, attempts int) *RetryableT
}

func (t *RetryableTransport) Submit(op *runtime.ClientOperation) (interface{}, error) {
client := &http.Client{}
var client http.Client
if op.Client == nil {
*client = *http.DefaultClient
client = *http.DefaultClient
} else {
*client = *op.Client
client = *op.Client
}

transport := client.Transport
Expand All @@ -47,7 +47,7 @@ func (t *RetryableTransport) Submit(op *runtime.ClientOperation) (interface{}, e
attempts: t.attempts,
}

op.Client = client
op.Client = &client
res, err := t.tr.Submit(op)

return res, err
Expand Down

0 comments on commit c065ece

Please sign in to comment.