Open dtscalac opened 1 week ago
Hi! Thanks for opening your first issue here! :smile:
I'm not sure if --disable-web-security bypasses all issues related to cross-origin and shared buffers though it would seem like a perfect solution if it worked.
That looks pretty reasonable!
It seems this is not a but of flutter_rust_bridge, but something that we can issue/PR to Flutter.
Btw, the header for flutter run
was PRed in https://github.com/flutter/flutter/pull/136297 by @aran to support easier usage of flutter_rust_bridge. For flutter drive
maybe able to mimic that PR.
Btw, the header for flutter run was PRed in https://github.com/flutter/flutter/pull/136297 by @aran to support easier usage of flutter_rust_bridge. For flutter drive maybe able to mimic that PR.
Thank you for the recommendation. I will contribute during this weekend the option to add custom headers to flutter drive
command in the flutter repository. Should we keep this issue open as reference that I can issue to justify the need for extra options?
Sure, feel free to leave this issue open!
Raised an issue in flutter repository: https://github.com/flutter/flutter/issues/159037
Will link the flutter's PR to the flutter issue once it is ready.
Is your feature request related to a problem? Please describe. flutter_rust_bridge generated code cannot be run in integration tests via
flutter drive
on Flutter web because theflutter drive
command seems to not support the--web-header
option described in https://cjycode.com/flutter_rust_bridge/manual/miscellaneous/web-cross-origin#when-flutter-run.Attempting to run an integration test that tries to call code generated by the flutter_rust_bridge:
Resulting in:
Describe the solution you'd like Make it possible to run flutter_rust_bridge generated code in integration tests on Flutter web.
Since it seems that
flutter drive
doesn't support the--web-header
option a usual approach would be to use--disable-web-security
flag for chrome. When this flag is set the flutter_rust_bridge should no longer throwmissing cross-origin headers
errors since we made the browser not require these headers.I'm not sure if
--disable-web-security
bypasses all issues related to cross-origin and shared buffers though it would seem like a perfect solution if it worked.Describe alternatives you've considered Tried setting up my own web-server that adds the missing cross-origin headers however it looks like this solution is not compatible with
flutter drive
which always runs it's own web-server which we don't control.