pytracking icon indicating copy to clipboard operation
pytracking copied to clipboard

case insensitivity in URLs

Open WilliamWCYoung opened this issue 3 years ago • 2 comments

We have a situation where a users email client is lowering the URL. This doesn't work with the base-64 encoded data in the URL. Is there a way/planned feature to specifiy our own encoding, e.g. base-32?

Thank you!

WilliamWCYoung avatar Jan 04 '22 14:01 WilliamWCYoung

Stumbled on this issue while tinkering with the module. Could need some more tests and docs, do you know if the project is still active? Otherwise I'll fork it and add some updates. It's very useful.

For your question, the module is quite short (1 file, tracking.py), if you edit those lines:

https://github.com/powergo/pytracking/blob/master/pytracking/tracking.py#L140-L141

https://github.com/powergo/pytracking/blob/master/pytracking/tracking.py#L186-L187

For the encoding and decoding, using base64.base32encode & .lower() on the sending end then .upper() & base64.base32decode on the receiving end you should work around the limitation.

Note: this leaves out the tracking pixel, but I'm sure there are ways to add that too. Hope this helps, have a great week.

KarimJedda avatar Feb 07 '22 23:02 KarimJedda

You too! This is the approach we went with in the end, base32 and force lower!

WilliamWCYoung avatar Feb 10 '22 09:02 WilliamWCYoung