diff --git a/.changes/fix-windows-timeout-http.md b/.changes/fix-windows-timeout-http.md new file mode 100644 index 000000000..a45cdd1fb --- /dev/null +++ b/.changes/fix-windows-timeout-http.md @@ -0,0 +1,5 @@ +--- +"tauri": patch +--- + +Fixes HTTP timeout not working on Windows when using the `attohttpc` client. diff --git a/core/tauri/src/api/http.rs b/core/tauri/src/api/http.rs index c62a6dfc2..7f34b5f9b 100644 --- a/core/tauri/src/api/http.rs +++ b/core/tauri/src/api/http.rs @@ -143,6 +143,11 @@ impl Client { if let Some(timeout) = request.timeout { request_builder = request_builder.timeout(timeout); + #[cfg(windows)] + { + // on Windows the global timeout is not respected, see https://github.com/sbstp/attohttpc/issues/118 + request_builder = request_builder.read_timeout(timeout); + } } let response = if let Some(body) = request.body {