Page 1 of 1

CORS issues

Posted: Sun Mar 01, 2026 7:00 pm
by PingLing
Hi, there seems to be something wrong with the config. I get hundreds of these on the console (W10, MS Edge / Firefox) and no images are shown:

Access to image at 'http://berryaudio.local:8080/images/loc ... 2856dd.jpg' from origin 'http://berryaudio.local' has been blocked by CORS policy: The request client is not a secure context and the resource is in more-private address space `local`.

Is it something I should adjust on my end? Only once I saw the images, no idea why. Playback itself works fine.

Re: CORS issues

Posted: Sun Mar 01, 2026 8:55 pm
by varungujjar
Hi you should just use the link http://berryaudio.local

PS: your image attachment is missing :)

Let me know

Re: CORS issues

Posted: Mon Mar 02, 2026 12:13 am
by PingLing
Yes, that's how I'm accessing it. See screenshots from my phone (Chrome, Android 16) - it's exactly as on my PC.

https://www.flickr.com/gp/piotr_ingling/2yj3Fus014

https://www.flickr.com/gp/piotr_ingling/9mz944Jmud

Re: CORS issues

Posted: Mon Mar 02, 2026 10:51 pm
by PingLing
It seems that all is fine when I access http://berryaudio.local:8080 - because the images are loaded from urls with 8080 port. I'm using the unmodified config and I don't see any configuration option to change it from the UI.

Re: CORS issues

Posted: Mon Mar 02, 2026 11:23 pm
by varungujjar
PingLing wrote: Mon Mar 02, 2026 10:51 pm It seems that all is fine when I access http://berryaudio.local:8080 - because the images are loaded from urls with 8080 port. I'm using the unmodified config and I don't see any configuration option to change it from the UI.
hmm its strange considering that all images are served from berryaudio.local directly instead of port. However I will just burn a fresh image to another pi and test this tommorow and update here.

Re: CORS issues

Posted: Tue Mar 03, 2026 11:32 am
by PingLing
The web.py explicitly sets the port to 8080 :-)

Code: Select all

async def run_server(self):
        host = "0.0.0.0"
        port = 8080

Re: CORS issues

Posted: Tue Mar 03, 2026 4:21 pm
by varungujjar
So running webserver on 80 requires root privileges which is not good hence the use of port 8080 which is then proxied using nginx

Re: CORS issues

Posted: Wed Mar 04, 2026 12:19 am
by PingLing
varungujjar wrote: Mon Mar 02, 2026 11:23 pm hmm its strange considering that all images are served from berryaudio.local directly instead of port.
It's not what the console says :-) In my case all images are loaded from :8080. And, for CORS policy, the berryaudio.local and berryaudio.local:8080 are not the same origin, hence the images don't load.

When I access from berryaudio.local
https://www.flickr.com/gp/piotr_ingling/3q7h03LXF4
https://www.flickr.com/gp/piotr_ingling/b13D03c70r

When I access from berryaudio.local:8080
https://www.flickr.com/gp/piotr_ingling/626R6Kr300
https://www.flickr.com/gp/piotr_ingling/NBar8T4E7D

Re: CORS issues

Posted: Wed Mar 04, 2026 1:14 am
by varungujjar
Ah understood!, I will get back to you with a solution in next 2 days. Will server the images to nginx proxy so they would be seen at berryaudio.local/images and not berryaudio.local:8080