The code for creating request bodies on android always sets the body to be an empty vec:
|
let final_request = match request_builder.body(Vec::new()) { |
|
Ok(req) => req, |
|
Err(e) => { |
|
#[cfg(feature = "tracing")] |
|
tracing::warn!("Failed to build response: {}", e); |
|
return Ok(*JObject::null()); |
|
} |
|
}; |
No other platforms do this, breaking custom protocol support on android.
The core reason is because android's shouldInterceptRequest doesn't provide the body. I would imagine wry should paper over this issue rather than let it bubble up to user code.
You can work around this by exposing a JavaScriptInterface object to the webview as shown here
https://github.com/acsbendi/Android-Request-Inspector-WebView/blob/master/app/src/main/java/com/acsbendi/requestinspectorwebview/RequestInspectorJavaScriptInterface.kt
The code for creating request bodies on android always sets the body to be an empty vec:
wry/src/android/binding.rs
Lines 160 to 167 in cbbcccc
No other platforms do this, breaking custom protocol support on android.
The core reason is because android's shouldInterceptRequest doesn't provide the body. I would imagine wry should paper over this issue rather than let it bubble up to user code.
You can work around this by exposing a JavaScriptInterface object to the webview as shown here
https://github.com/acsbendi/Android-Request-Inspector-WebView/blob/master/app/src/main/java/com/acsbendi/requestinspectorwebview/RequestInspectorJavaScriptInterface.kt