Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Zercerium opened this issue Sep 19, 2023 · 0 comments

Comments

@Zercerium
Copy link
Contributor

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

fn ipc_router<U: Send + Sync + 'static>(self, router: Router<U>) -> Self {
let router = Arc::new(router);
self.register_asynchronous_uri_scheme_protocol("ipc", move |_app, req, responder| {
let router = router.clone();

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant