coderadio-client
coderadio-client copied to clipboard
fix: code radio not working on Safari browser
Checklist:
- [x] I have read freeCodeCamp's contribution guidelines.
- [x] My pull request has a descriptive title (not a vague title like
Update index.md)
Closes #292
@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.
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.