fix(core): HTTP timeout not working on Windows, closes #4050 (#4185)

This commit is contained in:
Lucas Fernandes Nogueira
2022-05-21 06:54:22 -07:00
committed by GitHub
parent ae99f99167
commit d99c5d583b
2 changed files with 10 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
---
"tauri": patch
---
Fixes HTTP timeout not working on Windows when using the `attohttpc` client.

View File

@@ -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 {