pytracking
pytracking copied to clipboard
case insensitivity in URLs
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!
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.
You too! This is the approach we went with in the end, base32 and force lower!