Skip to content

Commit 3dbb734

Browse files
committed
Modify unique token to use url safe characters.
Looks like the merge of the methods I chose cause url unsafe / to be emitted sometimes. This causes poe post to fail as the url includes the key and the / messes up the rest route url parsing code.
1 parent 8d9f141 commit 3dbb734

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

roundup/backends/sessions_common.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ def get_logger(self):
4141
return self.__logger
4242

4343
def getUniqueKey(self, length=40):
44-
otk = b2s(base64.b64encode(
44+
otk = b2s(base64.urlsafe_b64encode(
4545
random_.token_bytes(length))).rstrip('=')
4646
while self.exists(otk):
47-
otk = b2s(base64.b64encode(
47+
otk = b2s(base64.urlsafe_b64encode(
4848
random_.token_bytes(length))).rstrip('=')
4949

5050
return otk

0 commit comments

Comments
 (0)