From d7118e3d3cf5ef6bfb8ce3df9b55139d743ec0e7 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Fri, 3 Jun 2016 18:33:23 +0200 Subject: missing Reply-Nonce will be reported by Nonce() --- signer.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'signer.go') 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 } -- cgit v1.2.3