url: always strip username, password, port, fragment

This commit is contained in:
dumbmoron 2023-12-14 23:57:00 +00:00
parent e1fa32beb3
commit 18a3c06a9e
No known key found for this signature in database
GPG key ID: C59997C76C6A8E5F

View file

@ -60,9 +60,11 @@ export function cleanURL(url) {
} }
if (stripQuery) { if (stripQuery) {
url.search = url.hash = '' url.search = ''
} }
url.username = url.password = url.port = url.hash = ''
if (url.pathname.endsWith('/')) if (url.pathname.endsWith('/'))
url.pathname = url.pathname.slice(0, -1); url.pathname = url.pathname.slice(0, -1);