api: ignore empty nonces (#27945)

This commit is contained in:
Frédéric Péters 2018-11-13 15:24:27 +01:00
parent 18dedba966
commit c6e536e02e
1 changed files with 1 additions and 1 deletions

View File

@ -71,7 +71,7 @@ def is_url_signed(utcnow=None, duration=DEFAULT_DURATION):
% (duration, delta))
# check nonce
nonce = get_request().form.get('nonce')
if nonce is not None:
if nonce:
# compute end date of the nonce as an unix timestamp
until = timestamp + datetime.timedelta(seconds=duration)
until = calendar.timegm(until.timetuple())