File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Flow.Launcher.Infrastructure/Http Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -75,12 +75,12 @@ public static void UpdateProxy()
75
75
}
76
76
}
77
77
78
- public async static Task Download ( [ NotNull ] string url , [ NotNull ] string filePath )
78
+ public static async Task Download ( [ NotNull ] string url , [ NotNull ] string filePath )
79
79
{
80
80
using var response = await client . GetAsync ( url ) ;
81
81
if ( response . StatusCode == HttpStatusCode . OK )
82
82
{
83
- using var fileStream = new FileStream ( filePath , FileMode . CreateNew ) ;
83
+ await using var fileStream = new FileStream ( filePath , FileMode . CreateNew ) ;
84
84
await response . Content . CopyToAsync ( fileStream ) ;
85
85
}
86
86
else
@@ -93,7 +93,7 @@ public static async Task<string> Get([NotNull] string url, string encoding = "UT
93
93
{
94
94
Log . Debug ( $ "|Http.Get|Url <{ url } >") ;
95
95
var response = await client . GetAsync ( url ) ;
96
- using var stream = await response . Content . ReadAsStreamAsync ( ) ;
96
+ await using var stream = await response . Content . ReadAsStreamAsync ( ) ;
97
97
using var reader = new StreamReader ( stream , Encoding . GetEncoding ( encoding ) ) ;
98
98
var content = await reader . ReadToEndAsync ( ) ;
99
99
if ( response . StatusCode == HttpStatusCode . OK )
You can’t perform that action at this time.
0 commit comments