Pārlūkot izejas kodu

feat(core): implement max_redirections for attohttpc, ref #4795 (#4811)

Lucas Fernandes Nogueira 3 gadi atpakaļ
vecāks
revīzija
ba5560b2a1

+ 5 - 0
.changes/attohttpc-max-redirections.md

@@ -0,0 +1,5 @@
+---
+"tauri": patch
+---
+
+Implement `api::http::ClientBuilder::max_redirections` for the default attohttpc client.

+ 4 - 0
core/tauri/src/api/http.rs

@@ -141,6 +141,10 @@ impl Client {
       }
     }
 
+    if let Some(max_redirections) = self.0.max_redirections {
+      request_builder = request_builder.max_redirections(max_redirections as u32);
+    }
+
     if let Some(timeout) = request.timeout {
       request_builder = request_builder.timeout(timeout);
       #[cfg(windows)]