Hello,
I have a react app which is retrieving img data from a google cloud storage bucket, but am getting CORS policy issues when trying to access the same bucket from within Babylon. Looking through the request headers, it looks like ‘Sec-Fetch-Mode’ is set to ‘cors’ for Babylon and ‘no-cors’ for the React img request.
In the documentation I have found WebRequest.CustomRequestHeaders and a Tools.SetCorsBehavior function which seem promising, but I have been unable to affect the behavior so far. In the case of CustomRequestHeaders, setting ‘Sec-Fetch-Mode’ to ‘no-cors’ is not allowed, and I have not been able to get SetCorsBehavior to work.
Tools.SetCorsBehavior(fileUrl, { crossOrigin: null });
The code above was based on the only example implementation I could find, and may not be correct.
Let me know if you have any experience with customizing request headers or modifying cors policy on fetches made through SceneLoader (LoadAssetContainerAsync), and thanks,
Robert