Hi everyone! I'm trying to migrate to 2.0 and i'm struggling with writing files with Rust: (pic 1)
I couldn't find this anywhere, this is my security config: (pic 2)
How can i fix this problem? Using pic 3 Tauri version
52 messages · Page 1 of 1 (latest)
Hi everyone! I'm trying to migrate to 2.0 and i'm struggling with writing files with Rust: (pic 1)
I couldn't find this anywhere, this is my security config: (pic 2)
How can i fix this problem? Using pic 3 Tauri version
and I also stole function from here: https://github.com/tauri-apps/tauri/issues/9322#issuecomment-2029855260
May sound random, but do you use sentry in your app?
That's the only thing i can remember that caused this issue in the past
if not, could you create a minimal reproduction repo we can test?
i dont
sure, here it is: https://github.com/MegaSa1nt/TauriCORSTest
same error for me
my app also has this unexpected border
😭
is there any way to disable cors?
only on windows with the --disable-web-security flag which we only recommend in edge cases
my app is only for windows, ill test it, thanks!
if you need cross platform support you have to use tauri's http api
which, i'd also recommend for windows because the flag is a bit extreme
the flag is for this config btw https://tauri.app/v1/api/config/#windowconfig.additionalbrowserargs
wdym http api? how can i use it for invoke?
my bad, mixed up the threads
dw
does this also happen if your command accepts Vec<u8> instead of IpcRequest?
actually, your invoke call is wrong
i took it from here
brb
So what i don't understand is how this works for them in the gh issue
I assume they tested this on Linux and webkitgtk's cors / http-request implementation is broken / doesn't follow the standards.
Because looking at tauri's code (which took a while because i haven't looked at the ipc code for ages) the error you're seeing is correct / expected
@late monolith is this intentional? On one hand we clearly set the allowed headers in ipc/protocol.rs and on the other hand we're exposing this: https://beta.tauri.app/references/v2/js/core/namespacecore/#properties-3
when using --disable-web-security flag, it just sends 400 without any error in DevTools or console
So if this error is expected and im trying to run simple invoke command, what i need to do to fix this error?
When trying to use this function with 8mb Uint8Array, it halts program for 10-20 seconds, then responding "no"
for now you'll have to remove the headers.
What about #1230067994017927179 message?
Thanks for your answers anyway
Discord is the easiest way to communicate over voice, video, and text. Chat, hang out, and stay close with your friends and communities.
I think the is-array check logic in the ipc is wrong and it doesn't send the uint8array as binary data.
uhh, what can i do?
i assume this links to the invoke headers right? we should allow any headers indeed (this is useful when the invoke body is supposed to be vec<u8> but you also want to pass other metadata - was designed for the channel api)
are you using the isolation pattern? i assume no right?
idk what that means 😔 i run command this way:
window.__TAURI__.core.invoke("greet", new Uint8Array(chunk), {
headers: {
file: 'test.mp3',
end: "true"
}
}).catch(e => {
console.log(e);
});
works fine on macOS (even the headers work fine @meager magnet 😂 maybe that's why i didn't catch that issue before - windows is my third OS pretty much)
sending a 72mb file using the IPC takes 2.5 seconds
or something like that in debug mode - my inspector is buggy for some reason
i'll try windowws
a similar function works fine on my end (fixing the headers on the tauri side first ofc)
super fast
btw you should do greetMsgEl.textContent = await so you're not writing a promise to that element
sure
i'm using a 27mb file this time
maybe i can just push the header fix first
what i've been trying is to read a large file, then writing it to a different location
with these two changes
if you can push your code to a repo I can try it too
Contribute to MegaSa1nt/TauriCORSTest development by creating an account on GitHub.