diff --git a/src/renderer/api/subsonic/subsonic-controller.ts b/src/renderer/api/subsonic/subsonic-controller.ts index f80df62e..4ecfef6c 100644 --- a/src/renderer/api/subsonic/subsonic-controller.ts +++ b/src/renderer/api/subsonic/subsonic-controller.ts @@ -65,7 +65,7 @@ export const SubsonicController: ControllerEndpoint = { const cleanServerUrl = `${url.replace(/\/$/, '')}/rest`; if (body.legacy) { - credential = `u=${body.username}&p=${body.password}`; + credential = `u=${encodeURIComponent(body.username)}&p=${encodeURIComponent(body.password)}`; credentialParams = { p: body.password, u: body.username, @@ -73,7 +73,7 @@ export const SubsonicController: ControllerEndpoint = { } else { const salt = randomString(12); const hash = md5(body.password + salt); - credential = `u=${body.username}&s=${salt}&t=${hash}`; + credential = `u=${encodeURIComponent(body.username)}&s=${encodeURIComponent(salt)}&t=${encodeURIComponent(hash)}`; credentialParams = { s: salt, t: hash,