MCPcopy
hub / github.com/remoteintech/remote-jobs / cleanFinalUrl

Function cleanFinalUrl

scripts/fix-links.mjs:511–518  ·  view source on GitHub ↗
(url)

Source from the content-addressed store, hash-verified

509// Strip ALL query params from a final URL before writing it back. Redirect-added
510// params are nearly always tracking/session noise that shouldn't end up persisted.
511function cleanFinalUrl(url) {
512 const u = safeUrl(url);
513 if (!u) return url;
514 u.search = '';
515 u.hash = '';
516 if ((u.protocol === 'https:' && u.port === '443') || (u.protocol === 'http:' && u.port === '80')) u.port = '';
517 return u.href;
518}
519
520// Apply only the safest changes:
521// - Remove parked-domain profiles (eco-mind pattern)

Callers 1

fix-links.mjsFile · 0.85

Calls 1

safeUrlFunction · 0.85

Tested by

no test coverage detected