File: unset-proxy-vars-in-test.patch

package info (click to toggle)
rust-reqwest 0.12.15-5
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,860 kB
  • sloc: makefile: 2
file content (48 lines) | stat: -rw-r--r-- 1,628 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
Index: reqwest/src/proxy.rs
===================================================================
--- reqwest.orig/src/proxy.rs
+++ reqwest/src/proxy.rs
@@ -1291,6 +1291,9 @@ mod tests {
         let _g1 = env_guard("HTTP_PROXY");
         let _g2 = env_guard("http_proxy");
         let _g3 = env_guard("ALL_PROXY");
+        let _g4 = env_guard("HTTPS_PROXY");
+        let _g5 = env_guard("all_proxy");
+        let _g6 = env_guard("https_proxy");
 
         // Mock ENV, get the results, before doing assertions
         // to avoid assert! -> panic! -> Mutex Poisoned.
@@ -1308,6 +1311,10 @@ mod tests {
         // reset user setting when guards drop
         drop(_g1);
         drop(_g2);
+        drop(_g3);
+        drop(_g4);
+        drop(_g5);
+        drop(_g6);
         // Let other threads run now
         drop(_lock);
 
@@ -1397,9 +1404,13 @@ mod tests {
         // save system setting first.
         let _g1 = env_guard("REQUEST_METHOD");
         let _g2 = env_guard("HTTP_PROXY");
+        let _g3 = env_guard("HTTPS_PROXY");
+        let _g4 = env_guard("ALL_PROXY");
 
         // Mock ENV, get the results, before doing assertions
         // to avoid assert! -> panic! -> Mutex Poisoned.
+        env::remove_var("HTTPS_PROXY");
+        env::remove_var("ALL_PROXY");
         env::set_var("HTTP_PROXY", "http://evil/");
 
         let baseline_proxies = get_sys_proxies(None);
@@ -1411,6 +1422,8 @@ mod tests {
         // reset user setting when guards drop
         drop(_g1);
         drop(_g2);
+        drop(_g3);
+        drop(_g4);
         // Let other threads run now
         drop(_lock);