Compare commits

..

2 Commits

Author SHA1 Message Date
jeffvli be0ebac362 Update to v0.12.1 2024-11-20 10:50:04 -08:00
Mitja Ševerkar 8eb8290fc4 Fix URL encoding on Subsonic (#850)
* Revert "Encode credential for subsonic stream/coverart (#841)"

This reverts commit 8ec4551b46.

* Properly URL encode credentials on Subsonic

Previous commit (8ec4551b46) has been reverted, as it has encoded even equal signs (=), and and signs (&), which should not have been encoded. Nextcloud Music has subsequently failed to receive separate username and password and has therefore failed whilst authenticating the user.

Example of URL beforehand:
https://cloud.example.com/index.php/apps/music/subsonic/rest/stream.view?id=track-4936&v=1.13.0&c=feishin_&u%3Dtest-test%40example.com%26p%3Dpassword

Example of URL now:
https://cloud.example.com/index.php/apps/music/subsonic/rest/stream.view?id=track-4936&v=1.13.0&c=feishin_&u=test-test%40example.com&p=password
2024-11-19 19:00:53 -08:00
6 changed files with 13 additions and 14 deletions
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "feishin",
"version": "0.12.0",
"version": "0.12.1",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "feishin",
"version": "0.12.0",
"version": "0.12.1",
"hasInstallScript": true,
"license": "GPL-3.0",
"dependencies": {
+1 -1
View File
@@ -2,7 +2,7 @@
"name": "feishin",
"productName": "Feishin",
"description": "Feishin music server",
"version": "0.12.0",
"version": "0.12.1",
"scripts": {
"build": "concurrently \"npm run build:main\" \"npm run build:renderer\" \"npm run build:remote\"",
"build:main": "cross-env NODE_ENV=production TS_NODE_TRANSPILE_ONLY=true webpack --config ./.erb/configs/webpack.config.main.prod.ts",
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "feishin",
"version": "0.12.0",
"version": "0.12.1",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "feishin",
"version": "0.12.0",
"version": "0.12.1",
"hasInstallScript": true,
"license": "GPL-3.0",
"dependencies": {
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "feishin",
"version": "0.12.0",
"version": "0.12.1",
"description": "",
"main": "./dist/main/main.js",
"author": {
@@ -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,
@@ -24,15 +24,14 @@ const getCoverArtUrl = (args: {
return null;
}
const url =
return (
`${args.baseUrl}/rest/getCoverArt.view` +
`?id=${args.coverArtId}` +
`&${encodeURIComponent(args.credential || '')}` +
`&${args.credential}` +
'&v=1.13.0' +
'&c=feishin' +
`&size=${size}`;
return url;
`&size=${size}`
);
};
const normalizeSong = (
@@ -49,7 +48,7 @@ const normalizeSong = (
size: size || 300,
}) || null;
const streamUrl = `${server?.url}/rest/stream.view?id=${item.id}&v=1.13.0&c=feishin_${deviceId}&${encodeURIComponent(server?.credential || '')}`;
const streamUrl = `${server?.url}/rest/stream.view?id=${item.id}&v=1.13.0&c=feishin_${deviceId}&${server?.credential}`;
return {
album: item.album || '',