strip tracking parameters when parsing urls

pull/1/head
ansuz 7 years ago
parent af1ea4fd96
commit b96ea47f1f

@ -245,6 +245,17 @@ define([
hd.type === 'invite');
}, "test support for invite urls");
assert(function (cb) {
var url = '/pad/?utm_campaign=new_comment&utm_medium=email&utm_source=thread_mailer#/1/edit/3Ujt4F2Sjnjbis6CoYWpoQ/usn4+9CqVja8Q7RZOGTfRgqI/';
var secret = Cryptpad.parsePadUrl(url);
return cb(secret.hashData.version === 1 &&
secret.hashData.mode === "edit" &&
secret.hashData.channel === "3Ujt4F2Sjnjbis6CoYWpoQ" &&
secret.hashData.key === "usn4+9CqVja8Q7RZOGTfRgqI" &&
!secret.hashData.present);
}, "test support for ugly tracking query paramaters in url");
assert(function (cb) {
// TODO
return cb(true);

@ -114,6 +114,7 @@ Version 1
if (!href) { return ret; }
if (href.slice(-1) !== '/') { href += '/'; }
href = href.replace(/\/\?[^#]+#/, '/#');
var idx;

Loading…
Cancel
Save