Search Unity

Problems with Unity WebGL Cross-Origin Resource Sharing, Safari and S3

Discussion in 'Web' started by jareds, Jul 21, 2017.

  1. jareds

    jareds

    Joined:
    May 8, 2008
    Posts:
    207
    Hello!

    We have some clients that use proxy servers so in order to get our Unity WebGL apps working properly we modified the UnityLoader.js and app_name.js files to add withCredentials = true to all of our XMLHttpRequests.

    This works well in all browers except Safari. For some reason, in Safari adding withCredentials = true causes Access-Control-Allow-Origin errors (Origin is not allowed by Access-Control-Allow-Origin. Failed to load resource). This is true in Safari whether we use the proxy server or not when withCredentials = true. If we remove withCredentials = true, it works outside of the proxy.

    Has anyone experienced this before? Our WebGL files are on S3 (behind a CDN). I'm not sure why Safari is behaving differently than the other browsers.

    Thanks,
    Jared