voronianski / soundcloud-audio.js

:musical_note: SoundCloud tracks and playlists with HTML5 Audio API
http://caniuse.com/#feat=audio
284 stars 46 forks source link

Doesn't work with Safari's DNT header #16

Closed denkristoffer closed 7 years ago

denkristoffer commented 7 years ago

This isn't really soundcloud-audio.js's fault, but maybe we can think of a way around this problem together?

The way that the SoundCloud API's CORS is currently set up, it rejects requests with the DNT header. Unfortunately it seems like Safari adds this header on its own to all XHR requests when the setting is enabled, which gives us the following result:

screen shot 2017-01-24 at 22 25 52

Current versions of Safari don't support Fetch either, so that won't help here. Can you think of other possible solutions that won't leave DNT-enabled users left out?

I've written SoundCloud's dev account on Twitter about this so hopefully they're willing to whitelist the DNT header.

denkristoffer commented 7 years ago

I've just tried with Safari Technology Preview, it seems to work even without using Fetch. I'll try to investigate further.

voronianski commented 7 years ago

@sachse thanks!

denkristoffer commented 7 years ago

This is no longer an issue in Safari Technology Preview, so the technical issue of the header being added automatically seems to have been solved. I haven't heard back from SoundCloud at all after trying to reach them in a few different ways though, so this is still going to be an issue for anyone using a stable version of Safari with DNT enabled. It doesn't seem like we can do anything about that, unfortunately 😒

Might as well close this.