We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c7e5cda commit d0c319dCopy full SHA for d0c319d
1 file changed
src/onelogin/saml2/utils.py
@@ -98,8 +98,14 @@ def decode_base64_and_inflate(value):
98
:returns: the string after decoding and inflating
99
:rtype: string
100
"""
101
+ decoded = base64.b64decode(value)
102
+ # We try to inflate
103
+ try:
104
+ result = zlib.decompress(decoded, -15)
105
+ except Exception:
106
+ result = decoded
107
- return zlib.decompress(base64.b64decode(value), -15).decode('utf-8')
108
+ return result.decode('utf-8')
109
110
@staticmethod
111
def deflate_and_base64_encode(value):
0 commit comments