@latch I’ve uploaded the project here (for the future, it’s always handy if you can upload a project to the shared vault for debugging ):
Using this browser branch, with updated electron which I’m working on:
I enter a URL of a json file: safe://hbkygony7b8kajf6i9pan37mxa5ujt9regiqg8o93wqtubk9pi8fintf6f (the fetchsafe.json file itself)
The error itself is a CORS error as @happybeing was suggesting :
Access to fetch at 'safe://hbkygony7b8kajf6i9pan37mxa5ujt9regiqg8o93wqtubk9pi8fintf6f/' from origin 'safe://hnyynyz1t6uezzn81kee3x6ikrasnho33h8f5txek3imchj14z53t69fwebnc' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
we’re not setting any AccessControl policy in our
fetch.js func we use for returning data from the network. We could. I’m not sure we should… Or if we do, what that policy should be.
Would be happy to get suggestions on that, or PRs to improve this.
On the rust-http server front, this
fetch.ts file above is essentially what we’d want to replace if we had such rust-server code. It wouldn’t be a bad project to get the logic setup in a simple rust server, tbh. We could then directly use this for the browser. Not sure we’ll get to that anytime soon though…