Skip to content

Commit aa88601

Browse files
committed
None algorithm now converts empty string to None prior to validation
1 parent 3e59fe6 commit aa88601

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

jwt/algorithms.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,13 @@ class NoneAlgorithm(Algorithm):
6969
operations are required.
7070
"""
7171
def prepare_key(self, key):
72+
if key == '':
73+
key = None
74+
7275
if key is not None:
7376
raise InvalidKeyError('When alg = "none", key value must be None.')
7477

75-
return None
78+
return key
7679

7780
def sign(self, msg, key):
7881
return b''

0 commit comments

Comments
 (0)