Closed adrianrv closed 1 year ago
I've just realised that base64.b64decode
remove unmatching characters if when validate
params is False (default value). For that reason I also think make sense to use the validation.
>>> base64.b64decode('dGVzdDoxMjM0').decode()
'test:1234'
>>> base64.b64decode('_____dGVzdDoxMjM0').decode()
'test:1234'
>>> base64.b64decode('____dGVzdDoxMjM0', validate=True).decode()
# raise binascii.Error('Non-base64 digit found')
Thanks. This is a good fix. I wish I saw it sooner :(
Fixing decoding base64 string issue.
Fix #7