mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 05:07:41 +00:00
GUACAMOLE-839: Allow testing of null nonce values.
This commit is contained in:
@@ -120,13 +120,18 @@ public class NonceService {
|
|||||||
* invalidates that nonce.
|
* invalidates that nonce.
|
||||||
*
|
*
|
||||||
* @param nonce
|
* @param nonce
|
||||||
* The nonce value to test. Comparisons are case-insensitive.
|
* The nonce value to test. This value may be null, which will be
|
||||||
|
* considered an invalid nonce. Comparisons are case-insensitive.
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
* true if the provided nonce is valid, false otherwise.
|
* true if the provided nonce is valid, false otherwise.
|
||||||
*/
|
*/
|
||||||
public boolean isValid(String nonce) {
|
public boolean isValid(String nonce) {
|
||||||
|
|
||||||
|
// All null nonces are invalid.
|
||||||
|
if (nonce == null)
|
||||||
|
return false;
|
||||||
|
|
||||||
// Remove nonce, verifying whether it was present at all
|
// Remove nonce, verifying whether it was present at all
|
||||||
Long expires = nonces.remove(nonce.toLowerCase(Locale.US));
|
Long expires = nonces.remove(nonce.toLowerCase(Locale.US));
|
||||||
if (expires == null)
|
if (expires == null)
|
||||||
|
Reference in New Issue
Block a user