tauri-bindgen icon indicating copy to clipboard operation
tauri-bindgen copied to clipboard

Response to preflight request doesn't pass access control check: It does not have HTTP ok status.

Open Zercerium opened this issue 2 years ago • 0 comments

on windows the following error is popping up in the web devconsole

Access to fetch at 'http://ipc.localhost/__initialized' from origin 'http://localhost:1420' has been blocked by CORS 
policy: Response to preflight request doesn't pass access control check: It does not have HTTP ok status.

The code in Tauri has a special case for the __initialized request and works fine

      "__initialized" => match request.body.deserialize() {
        Ok(payload) => {
          manager.run_on_page_load(self, payload);
          resolver.resolve(());
        }
        Err(e) => resolver.reject(e.to_string()),
      },
...

https://github.com/tauri-apps/tauri/blob/d6fd1219743eca80793b9e54616b59391a3e1502/core/tauri/src/window.rs#L2115

which is overwritten by https://github.com/tauri-apps/tauri-bindgen/blob/1ae5e2abd63b81e76e81287674159b0636242673/crates/ipc-router-wip/src/lib.rs#L195-L200

quite not sure what the impact is, commands work fine with an adjusted url

Zercerium avatar Sep 19 '23 16:09 Zercerium