Created
May 17, 2012 20:41
-
-
Save danmactough/2721481 to your computer and use it in GitHub Desktop.
Sanitize Querystring
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function sanitizeQuerystring (url){ | |
var Url = require('url'); | |
var u = Url.parse(url, true); | |
delete u.search; | |
for (var key in u.query){ | |
/^utm_/.test(key) && delete u.query[key]; | |
} | |
return Url.format(u); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment