Commit 35d85e05 authored by Darko Poljak's avatar Darko Poljak

Encode/decode target URL with urlsafe functions.

parent 0630e5f8
......@@ -89,7 +89,7 @@ def x(url):
# allow only one request at a time
with lock:
durl = str.encode(url)
durl = base64.b64decode(durl)
durl = base64.urlsafe_b64decode(durl)
durl = zlib.decompress(durl)
aes = aes_new()
durl = aes.decrypt(durl)
......@@ -134,7 +134,7 @@ if __name__ == "__main__":
foo = str.encode(sys.argv[2])
foo = aes.encrypt(foo)
foo = zlib.compress(foo)
foo = base64.b64encode(foo)
foo = base64.urlsafe_b64encode(foo)
stdout_write(foo)
print()
sys.exit(0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment