diff options
Diffstat (limited to 'itsdangerous.py')
-rw-r--r-- | itsdangerous.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/itsdangerous.py b/itsdangerous.py index cdd2329..f618038 100644 --- a/itsdangerous.py +++ b/itsdangerous.py @@ -825,6 +825,11 @@ class TimedJSONWebSignatureSerializer(JSONWebSignatureSerializer): if 'exp' not in header: raise BadSignature('Missing expiry date', payload=payload) + try: + header['exp'] = int(header['exp']) + except ValueError: + raise BadHeader('Expiry date is not valid timestamp', payload=payload) + if not (isinstance(header['exp'], number_types) and header['exp'] > 0): raise BadSignature('expiry date is not an IntDate', |