owlbear-rodeo / kenku-fm

Online tabletop audio sharing for Discord
https://www.kenku.fm
GNU General Public License v3.0
189 stars 32 forks source link

Remote Control CORS errors #91

Closed Heonozis closed 1 year ago

Heonozis commented 1 year ago

Describe the bug I'm working on Owlbear Rodeo addon for Kenku FM control and can not achieve desirable result without having to do a custom build of Kenku.

I'm facing this bug: When connecting to my Kenku FM instance from the browser it gives CORS error because there is no cross origin allowed.

To Reproduce Steps to reproduce the behavior:

  1. Open Kenku FM
  2. Enable Remote control with default settings (127.0.0.1:3333)
  3. Go to https://google.com
  4. Open developer console
  5. run fetch('http://127.0.0.1:3333/v1/playlist')
  6. Error: Access to fetch at 'http://127.0.0.1:3333/v1/playlist' from origin 'https://www.google.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

Expected behavior Returned list of playlists as specified in documentation

Screenshots None

Desktop (please complete the following information):

Additional context After I made an adjustment suggested in this issue it worked.

Please consider adding flag in setting to allow CORS for integrations.

nthouliss commented 1 year ago

This is a duplicate of #62. Please put your use-case there, so we can track it as one issue.