aboutsummaryrefslogtreecommitdiff
path: root/signer.go
diff options
context:
space:
mode:
Diffstat (limited to 'signer.go')
-rw-r--r--signer.go12
1 files changed, 5 insertions, 7 deletions
diff --git a/signer.go b/signer.go
index f9c0378..d8d3b5d 100644
--- a/signer.go
+++ b/signer.go
@@ -91,13 +91,11 @@ func (s Signer) RoundTrip(req *http.Request) (*http.Response, error) {
if err != nil {
return nil, err
}
- nonce := resp.Header.Get("Replay-Nonce")
- if nonce == "" {
- return nil, errNoNonces
- }
- if len(s.nonces) == cap(s.nonces) {
- <-s.nonces // drop oldest
+ if nonce := resp.Header.Get("Replay-Nonce"); nonce != "" {
+ if len(s.nonces) == cap(s.nonces) {
+ <-s.nonces // drop oldest
+ }
+ s.nonces <- nonce
}
- s.nonces <- nonce
return resp, nil
}