File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Flow.Launcher.Infrastructure/Http Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -47,7 +47,14 @@ private get
47
47
}
48
48
}
49
49
50
- public static WebProxy WebProxy { get ; private set ; } = new WebProxy ( ) ;
50
+ private static WebProxy _proxy = new WebProxy ( ) ;
51
+ public static WebProxy WebProxy {
52
+ get
53
+ {
54
+ UpdateProxy ( ) ;
55
+ return _proxy ;
56
+ }
57
+ }
51
58
52
59
/// <summary>
53
60
/// Update the Address of the Proxy to modify the client Proxy
@@ -77,6 +84,7 @@ public static void UpdateProxy()
77
84
78
85
public static async Task Download ( [ NotNull ] string url , [ NotNull ] string filePath )
79
86
{
87
+ UpdateProxy ( ) ;
80
88
using var response = await client . GetAsync ( url ) ;
81
89
if ( response . StatusCode == HttpStatusCode . OK )
82
90
{
@@ -91,6 +99,7 @@ public static async Task Download([NotNull] string url, [NotNull] string filePat
91
99
92
100
public static async Task < string > Get ( [ NotNull ] string url , string encoding = "UTF-8" )
93
101
{
102
+ UpdateProxy ( ) ;
94
103
Log . Debug ( $ "|Http.Get|Url <{ url } >") ;
95
104
var response = await client . GetAsync ( url ) ;
96
105
await using var stream = await response . Content . ReadAsStreamAsync ( ) ;
You can’t perform that action at this time.
0 commit comments