jps0611 Posted March 8, 2018 Share Posted March 8, 2018 Howdy, Is there any way to customize how the blobs from textures in the GLTFLoader are treated? I'm running into an issue where the blobs are violating our content security policy because they are appended to our base url instead of the approved CDN the assets/textures are coming from. Let's say I'm pulling a GLTF asset via: let myAsset = assetsManager.addMeshTask("", "", "https://mycdn.com/static/gltf/", "my-asset.gltf"); So instead of: blob:https://myurl.me/24bde0c8-d576-4abb-a3f4-06a05b38b8f3 We get: https://mycdn.com/static/gltf/24bde0c8-d576-4abb-a3f4-06a05b38b8f3 Quote Link to comment Share on other sites More sharing options...
jps0611 Posted March 8, 2018 Author Share Posted March 8, 2018 @Deltakosh @bghgary any magic you know of to get around a CSP issue like this? Quote Link to comment Share on other sites More sharing options...
Guest Posted March 8, 2018 Share Posted March 8, 2018 Hum..nothing on top of my mind..Can you repro it somewhere? Quote Link to comment Share on other sites More sharing options...
bghgary Posted March 8, 2018 Share Posted March 8, 2018 @jps0611 I have a work item in the backlog to add a callback when the glTF loader loads a URI. It will allow you to do whatever you want with the URI. Short-term, you can override BABYLON.Tools.PreprocessUrl with a function that overrides the url. Note that this affects all URLs that go through BABYLON.Tools.LoadImage or BABYLON.Tools.LoadFile. Quote Link to comment Share on other sites More sharing options...
jps0611 Posted March 8, 2018 Author Share Posted March 8, 2018 Thanks @Deltakosh and @bghgary. Our team will take a look at the suggestions. Quote Link to comment Share on other sites More sharing options...
jps0611 Posted March 9, 2018 Author Share Posted March 9, 2018 Just to follow up here...we got around this issue by adding blob:oururl.com/* to our CSP. Gotta say...I'm really a big fan of babylon.js. We've got our first WebGL experience launching next week, and I don't think it would have turned out as well as it did with out the polish and documentation put into this framework. JPS bghgary 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.