feat(xen-api): support encoded credentials in URL

This commit is contained in:
Julien Fontanet 2018-08-21 17:46:18 +02:00
parent d15efae43f
commit 8a9f952ada

View File

@ -122,7 +122,14 @@ const parseUrl = url => {
}
const [, protocol = 'https:', username, password, hostname, port] = matches
return { protocol, username, password, hostname, port }
const parsedUrl = { protocol, hostname, port }
if (username !== undefined) {
parsedUrl.username = decodeURIComponent(username)
}
if (password !== undefined) {
parsedUrl.password = decodeURIComponent(password)
}
return parsedUrl
}
// -------------------------------------------------------------------