coderadio-client icon indicating copy to clipboard operation
coderadio-client copied to clipboard

fix: code radio not working on Safari browser

Open IgnorantSapient opened this issue 1 year ago • 1 comments

Checklist:

Closes #292

IgnorantSapient avatar Jan 26 '24 22:01 IgnorantSapient

@IgnorantSapient Thank you for reporting the issue and for the fix.

The failed test will be fixed once #296 is merged.


I spent hours looking into this, and want to post the investigation here for posterity.

We have Access-Control-Allow-Origin: * in the response header, and apparently Safari doesn't accept Access-Control-Allow-Origin" being a wildcard. So instead, we would need to be explicit in which origins we allow.

  • https://medium.com/prodigy-engineering/is-safari-getting-stricter-with-cors-8767c809c726

Some devices even require additional headers such as Content-Type", "Accept-Encoding", or "Range":

  • https://www.theoplayer.com/blog/the-pains-of-cross-origin-resource-sharing

The workaround is to not use CORS on Safari by omitting the crossorigin attribute, which is the change made by this PR.

huyenltnguyen avatar Feb 21 '24 07:02 huyenltnguyen

We have made some major changes to the code radio setup to improve the stability of the app. The changes also address the Safari issue, so I'm closing this PR in favor of #305.

huyenltnguyen avatar Jul 08 '24 08:07 huyenltnguyen