providers/saml: handle uncompressed SAML AuthNRequest

This commit is contained in:
Jens Langhammer
2020-02-16 14:08:35 +01:00
parent e138076e1d
commit 447e81d0b8
2 changed files with 7 additions and 3 deletions

View File

@ -6,7 +6,10 @@ import zlib
def decode_base64_and_inflate(b64string):
"""Base64 decode and ZLib decompress b64string"""
decoded_data = base64.b64decode(b64string)
return zlib.decompress(decoded_data, -15)
try:
return zlib.decompress(decoded_data, -15)
except zlib.error:
return decoded_data
def deflate_and_base64_encode(string_val):