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 f53dfa3 commit 81d24f8Copy full SHA for 81d24f8
uid2_client/uid2_base64_url_coder.py
@@ -11,14 +11,7 @@ def encode(input):
11
encoded_token = base64.urlsafe_b64encode(input).decode('ascii')
12
# urlsafe_b64encode doesn't remove the '=' padding per the spec so we should remove it
13
# as '=' is a reserved char in URL spec
14
- count = 0
15
- for i in range(3):
16
- if encoded_token[len(encoded_token) - 1 - i] == '=':
17
- count = count + 1
18
- # encoded_token[:-0] will empty the whole string!
19
- if count > 0:
20
- return encoded_token[:-count]
21
- return encoded_token
+ return encoded_token.rstrip('=')
22
23
@staticmethod
24
def decode(token):
0 commit comments