fix base64 padding
This commit is contained in:
parent
ea5aa0e80f
commit
5da9f4a410
@ -5,7 +5,7 @@ define(function() {
|
||||
var epoch = 1293840000;
|
||||
|
||||
var decode = function(str) {
|
||||
return atob(str + new Array(str.length % 4 + 1).join("="));
|
||||
return atob(str + new Array(4 - str.length % 4 + 1).join("="));
|
||||
};
|
||||
|
||||
var timestamp = function(str) {
|
||||
|
@ -114,7 +114,7 @@ class URLSafeTimedSerializer(TimedSerializer):
|
||||
|
||||
def load_payload(self, payload):
|
||||
try:
|
||||
json = base64.b64decode(payload + b"=" * (len(payload) % 4))
|
||||
json = base64.b64decode(payload + b"=" * (-len(payload) % 4))
|
||||
except Exception as e:
|
||||
raise BadPayload('Could not base64 decode the payload because of '
|
||||
'an exception', original_error=e)
|
||||
|
Loading…
Reference in New Issue
Block a user