Skip to content

Instantly share code, notes, and snippets.

@danmactough
Created May 17, 2012 20:41
Show Gist options
  • Save danmactough/2721481 to your computer and use it in GitHub Desktop.
Save danmactough/2721481 to your computer and use it in GitHub Desktop.
Sanitize Querystring
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