1
0
mirror of https://github.com/go-acme/lego.git synced 2024-11-28 17:41:10 +02:00

Merge pull request #185 from rekby/jws-out-of-range

Fix out of range
This commit is contained in:
xenolf 2016-04-12 02:41:31 +02:00
commit 23e88185c2

View File

@ -101,7 +101,9 @@ func (j *jws) Nonce() (string, error) {
return nonce, err
}
}
if len(j.nonces) == 0 {
return "", fmt.Errorf("Can't get nonce")
}
nonce, j.nonces = j.nonces[len(j.nonces)-1], j.nonces[:len(j.nonces)-1]
return nonce, nil
}