-
-
Notifications
You must be signed in to change notification settings - Fork 251
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
Can't make XHR request because wry is sending Content-Lenght header in GET request #717
Comments
Please see example repo and how to reproduce the error: |
Can confirm. Can't replicate the issue in windows. Seems to be working as intended. |
After some more digging I found out that the request sent by wry has a header that is Looking here:
Copying the request over into Postman and removing the |
I had a conversation with @myhrmans in discord and reached to the conclusion that this seems to be a bug in webkit2gtk. In order to reproduce this issue, we use
extern crate gio;
extern crate glib;
extern crate gtk;
extern crate webkit2gtk;
#[cfg(feature = "v2_4")]
use glib::ToVariant;
use gtk::{prelude::*, Inhibit, Window, WindowType};
#[cfg(feature = "v2_6")]
use webkit2gtk::UserContentManager;
use webkit2gtk::{
traits::{SettingsExt, WebContextExt, WebViewExt},
WebContext, WebView,
};
fn main() {
gtk::init().unwrap();
let window = Window::new(WindowType::Toplevel);
let context = WebContext::default().unwrap();
#[cfg(feature = "v2_4")]
context.set_web_extensions_initialization_user_data(&"webkit".to_variant());
context.set_web_extensions_directory("../webkit2gtk-webextension-rs/example/target/debug/");
#[cfg(feature = "v2_6")]
let webview =
WebView::new_with_context_and_user_content_manager(&context, &UserContentManager::new());
#[cfg(not(feature = "v2_6"))]
let webview = WebView::with_context(&context);
webview.load_uri("https://figma.com/mirror");
window.add(&webview);
let settings = WebViewExt::settings(&webview).unwrap();
settings.set_enable_developer_extras(true);
/*let inspector = webview.get_inspector().unwrap();
inspector.show();*/
window.show_all();
webview.run_javascript("alert('Hello');", None::<&gio::Cancellable>, |_result| {});
#[cfg(feature = "v2_22")]
webview.run_javascript("42", None::<&gio::Cancellable>, |result| match result {
Ok(result) => {
let value = result.js_value();
println!("is_boolean: {}", value.is_boolean(&context));
println!("is_number: {}", value.is_number(&context));
println!("{:?}", value.to_number(&context));
println!("{:?}", value.to_boolean(&context));
}
Err(error) => println!("{}", error),
});
let cancellable = gio::Cancellable::new();
webview.run_javascript("42", Some(&cancellable), |result| match result {
Ok(result) => {
let context = result.global_context().unwrap();
let value = result.value().unwrap();
println!("is_boolean: {}", value.is_boolean(&context));
println!("is_number: {}", value.is_number(&context));
println!("{:?}", value.to_number(&context));
println!("{:?}", value.to_boolean(&context));
}
Err(error) => println!("{}", error),
});
window.connect_delete_event(|_, _| {
gtk::main_quit();
Inhibit(false)
});
gtk::main();
}
The annoying thing is that same reproduction works fine in Gnome Web (previously called Epiphany) which depends on webkit2gtk. cc @wusyong |
I tested with plan C and can confirm the same error :/ |
Bugreport in webkit: Seems to be a problem in soup2, a fix is already present in soup3. So upgrading to soup3 would solve this issue. |
wry v0.25 now uses soup3 and tauri next branch has also merged it. |
Describe the bug
Have an issue in the wry window where I can't seem to make a XHR request when trying to sign in to a service.
The specific service Im trying to sign into is https://figma.com/mirror using SAML SSO.
Steps To Reproduce
On Linux clone this repository
https://github.com/myhrmans/tauri-wry-bug-xhr-error
Then follow the instructions in the repo.
Platform and Versions (please complete the following information):
OS: Ubuntu 22.04.1 LTS
Rustc: rustc 1.64.0 (a55dd71d5 2022-09-19)
Would you assign yourself to resolve this bug?
Additional context
This issue is only present on systems using the webkitgtk as far as I have tested.
webview2 does not have this issue.
The text was updated successfully, but these errors were encountered: