Skip to content

Commit

Permalink
fix(core): HTTP timeout not working on Windows, closes #4050 (#4185)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasfernog committed May 21, 2022
1 parent ae99f99 commit d99c5d5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changes/fix-windows-timeout-http.md
@@ -0,0 +1,5 @@
---
"tauri": patch
---

Fixes HTTP timeout not working on Windows when using the `attohttpc` client.
5 changes: 5 additions & 0 deletions core/tauri/src/api/http.rs
Expand Up @@ -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 {
Expand Down

0 comments on commit d99c5d5

Please sign in to comment.