Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Streaming, cover art and other images don't show when the username has URL reserved characters in it #841

Closed
gravelld opened this issue Nov 12, 2024 · 8 comments
Assignees
Labels
bug Something isn't working

Comments

@gravelld
Copy link

gravelld commented Nov 12, 2024

Expected Behavior

My username on a Subsonic server includes a "+" character. If I can log into a Subsonic server and display my library, the cover art should also display.

I should also be able to stream music.

Current Behavior

I am able to login to the server and browse my library. However, no cover art displays. Streaming music does not work.

Steps to Reproduce

  1. Create a user on the Subsonic server with a "+" in the username, e.g. [email protected]
  2. Login to the server with Feishin
  3. Observe artwork isn't shown
  4. Observe streaming doesn't work.

Possible Solution

The image and streaming query parameters should be URL encoded.

Context

I consulted the logs in Astiga and observed that most library browsing calls to getAlbum et al do have the username URL encoded (I think because Axios is used; this is default behaviour).

However, the calls to getCoverArt do not have the query parameters URL encoded. I think that's because the result of getCoverArt() is used verbatim in an HTML element.

Application version

0.11.1

Operating System and version

Linux

Server and Version

Astiga

Node Version (if developing locally)

No response

@gravelld gravelld added the bug Something isn't working label Nov 12, 2024
@Cambi0nn
Copy link

A little add-on (I'm the idiot with + in my email) that streaming itself also doesn't work. @gravelld can better tell if it's caused by only the image call or also by the stream call.

@gravelld
Copy link
Author

(I'm the idiot with + in my email)

😄

Ah yes! I forgot to mention the streaming - it also looks like that isn't encoded.

@gravelld gravelld changed the title Cover art and other images don't show when the username has URL reserved characters in it Streaming, cover art and other images don't show when the username has URL reserved characters in it Nov 13, 2024
@jeffvli jeffvli self-assigned this Nov 14, 2024
@jeffvli
Copy link
Owner

jeffvli commented Nov 14, 2024

Will be fixed in the next version

@jeffvli jeffvli closed this as completed Nov 14, 2024
mytja added a commit to mytja/feishin that referenced this issue Nov 20, 2024
jeffvli pushed a commit that referenced this issue Nov 20, 2024
* Revert "Encode credential for subsonic stream/coverart (#841)"

This reverts commit 8ec4551.

* Properly URL encode credentials on Subsonic

Previous commit (8ec4551) 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
@Cambi0nn
Copy link

Can it be re-opened? It indeed didn't work after the fix (I had asked @gravelld to look into it as I don't know if it was on Astiga's side or general and I hadn't heard back yet, hence not posting here), but with + not being encoded it also doesn't work.

I would think it would be possible to encode the username only, instead of the whole credentials string?

@jeffvli jeffvli reopened this Nov 21, 2024
@jeffvli
Copy link
Owner

jeffvli commented Nov 21, 2024

@Cambi0nn The + should be being encoded properly, at least my initial tests.

Are you able to open the browser devtools to check the actual request URL being sent during authentication?

@Cambi0nn
Copy link

Yes, the stream call gives me the following response:

<subsonic-response status="failed" version="1.16.0" serverVersion="Astiga/production" xmlns="http://subsonic.org/restapi">
 <error code="40" message="Wrong username or password."/>
</subsonic-response>

The coverart call used to do so, but now gives mo response. The images don't load however.

If I look at the payload, the + in my email seems to be a space in both the stream and the coverart calls (if I copy-paste the character it's: " ").

Since I'm logged in just fine and can browse my music, just not play it or see the cover art, I'm pretty sure it's not that my credentials are wrong.

@jeffvli
Copy link
Owner

jeffvli commented Nov 21, 2024

Did you remove and re-add the server in Feishin after the latest release?

@Cambi0nn
Copy link

Goddamit. I swear I did that with every test I did the passed month (I was talking with @gravelld for 2 weeks before it got posted here), beside this one... That did it indeed. Works perfectly!

@jeffvli jeffvli closed this as completed Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants