Skip to content

Commit ce104c0

Browse files
author
Roland Hedberg
committed
Py3 json can't abide with bytes.
1 parent ffbcc0f commit ce104c0

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/jwkest/jws.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,12 @@ def is_jws(self, jws):
653653

654654
try:
655655
# JWS JSON serialization
656-
json_jws = json.loads(jws)
656+
try:
657+
json_jws = json.loads(jws)
658+
except TypeError:
659+
jws = jws.decode('utf8')
660+
json_jws = json.loads(jws)
661+
657662
return self._is_json_serialized_jws(json_jws)
658663
except ValueError:
659664
return self._is_compact_jws(jws)

0 commit comments

Comments
 (0)