Selaa lähdekoodia

Merge remote-tracking branch 'origin/dev' into dev

DZW 4 vuotta sitten
vanhempi
commit
9c9e5389a1
1 muutettua tiedostoa jossa 2 lisäystä ja 4 poistoa
  1. 2 4
      handlers/HandlerBase.py

+ 2 - 4
handlers/HandlerBase.py

@@ -111,10 +111,8 @@ class BaseHandler(RequestHandler,DateUtils):
                 origStr = Authorization.split(' ')[1][::-1]
             except:
                 return False
-            if (len(origStr) % 3 == 1):
-                origStr += "=="
-            elif (len(origStr) % 3 == 2):
-                origStr += "="
+
+            origStr += (4-len(origStr)%4)*"="
             print(origStr)
             print(float(base64.b64decode(origStr.encode('utf-8')).decode(encoding='utf-8',errors='ignore')))
             b = str(float(base64.b64decode(origStr.encode('utf-8')).decode(encoding='utf-8',errors='ignore')) * int(self.now.day))[:10]