diff options
| author | 2020-05-21 20:29:44 -0700 | |
|---|---|---|
| committer | 2020-05-21 20:29:44 -0700 | |
| commit | e23aa887959059e17fc21dcab9c83db20dc987f5 (patch) | |
| tree | 64e36657425ea2b64bc901b0204c97da670354ed | |
| parent | Add a utility function to pad base64 data (diff) | |
Token remover: decode ID using URL-safe base64
Though I've not seen an ID with neither + and \ nor - and _, given that
the timestamp uses URL-safe encoding, the ID probably does too.
| -rw-r--r-- | bot/cogs/token_remover.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/bot/cogs/token_remover.py b/bot/cogs/token_remover.py index cae482e6e..5b4598959 100644 --- a/bot/cogs/token_remover.py +++ b/bot/cogs/token_remover.py @@ -150,7 +150,7 @@ class TokenRemover(Cog): b64_content = utils.pad_base64(b64_content) try: - decoded_bytes: bytes = base64.b64decode(b64_content) + decoded_bytes = base64.urlsafe_b64decode(b64_content) string = decoded_bytes.decode('utf-8') # isdigit on its own would match a lot of other Unicode characters, hence the isascii. |