soundcloud's 2.0 sdk works but 3.0 does not as

2019-02-18 22:56发布

问题:

I have a website, http://www.vertexshaderart.com, that was working fine until today. Suddenly, in Safari only, the XHR request initiated by calling

SC.get("/resolve", { url: someUrl } ...)

was failing. I checked a friend's webapp what was still working. The only difference was he's using the 2.0 sdk where as I was using the 3.0 sdk.

I switched to the 2.0 sdk and things started working again. Checking the headers sent the 3.0 sdk sends

http://api.soundcloud.com/resolve?url=someUrl&client_id=?????&format=json

where as the 2.0 sdk sends

http://api.soundcloud.com/resolve?url=someUrl&client_id=?????&format=json&_status_code_map[302]=200

The error in Safari is for the 3.0 SDK is

Failed to load resource: Request header field Accept-Encoding is not allowed by Access-Control-Allow-Headers

Is there a way to get the 3.0 sdk to work?