#Access-Control-Allow-Headers

52 messages · Page 1 of 1 (latest)

wanton lark
#

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

meager magnet
#

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?

wanton lark
#

i dont

wanton lark
wanton lark
#

my app also has this unexpected border

wanton lark
#

😭
is there any way to disable cors?

meager magnet
#

only on windows with the --disable-web-security flag which we only recommend in edge cases

wanton lark
#

my app is only for windows, ill test it, thanks!

meager magnet
#

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

wanton lark
meager magnet
#

my bad, mixed up the threads

wanton lark
#

dw

meager magnet
#

does this also happen if your command accepts Vec<u8> instead of IpcRequest?

#

actually, your invoke call is wrong

meager magnet
#

brb

meager magnet
#

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

wanton lark
wanton lark
wanton lark
#

When trying to use this function with 8mb Uint8Array, it halts program for 10-20 seconds, then responding "no"

meager magnet
wanton lark
meager magnet
#

I think the is-array check logic in the ipc is wrong and it doesn't send the uint8array as binary data.

wanton lark
#

uhh, what can i do?

late monolith
late monolith
#

the check should be right

late monolith
wanton lark
#

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);
  });
late monolith
#

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

late monolith
#

super fast

#

btw you should do greetMsgEl.textContent = await so you're not writing a promise to that element

wanton lark
#

sure

late monolith
#

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

wanton lark