CORS or "Access-Control-Allow-Origin" problem

Need help? Post your questions here.
martian1530
Posts: 5
Joined: 31 Jul 2014, 15:15
Has thanked: 1 time
Been thanked: 3 times

CORS or "Access-Control-Allow-Origin" problem

Unread post by martian1530 »

Hi,
I've been searching around the forum and didn't find anything related to my problem, so I decided to open a new topic.
I've been running Madsonic on a raspberry at home and I have to say I owe You people a huge THANK YOU for writing such a nice piece of software.
Since raspberry is very limited when it comes to computing power, I've decided to write my own, very lightweight web player (maybe I'll share it with you guys, when the time is right 8-) ).
Now... I am hosting the player on the same raspberry. By using the REST API I've been able to access my music and stream it over an encrypted tunnel anywhere. However there is one problem.
When I try to load large data (for example a playlist with over a hundred songs in it, or an album with over hundred songs) Madsonic does not include the "Access-Control-Allow-Origin" HTTP header in the 200 OK response, making the browsers refuse the response. This header is always present in the response when loading smaller amounts of data.
I don't know if this is a bug or a feature... I'm just pointing it out, hoping someone will shed some light on it for me.
Btw, I've tried enabling CORS as described in various tutorials online but with no result. The problem persists.

Thanks in advance for any comments :)

Cheers!
These users thanked the author martian1530 for the post:
Madsonic
Rating: 7.69%
martian1530
Posts: 5
Joined: 31 Jul 2014, 15:15
Has thanked: 1 time
Been thanked: 3 times

Re: CORS or "Access-Control-Allow-Origin" problem

Unread post by martian1530 »

Hi,
I've done some research concerning this issue and so far I haven't been able to find any solution for Madsonic.
On the other hand, I found this for Subsonic:
http://sourceforge.net/p/subsonic/bugs/119/

I don't know if this is any help, but it might lead somebody in development to look at the issue :)

Cheers, guys!
These users thanked the author martian1530 for the post:
Madsonic
Rating: 7.69%
User avatar
Madsonic
Administrator
Administrator
Posts: 984
Joined: 07 Dec 2012, 03:58
Answers: 7
Has thanked: 1201 times
Been thanked: 470 times

Re: CORS or "Access-Control-Allow-Origin" problem

Unread post by Madsonic »

hi there,

with latest 5.1 its fixed.

https://github.com/MadMarty/madsonic-se ... va#L59-L61

best regards
These users thanked the author Madsonic for the post:
martian1530
Rating: 7.69%
martian1530
Posts: 5
Joined: 31 Jul 2014, 15:15
Has thanked: 1 time
Been thanked: 3 times

Re: CORS or "Access-Control-Allow-Origin" problem

Unread post by martian1530 »

Awesome, thanks a lot.
Post Reply