pref: 将Head和ETag请求设置为Connection: close

This commit is contained in:
ChingCdesu
2024-07-10 10:08:57 +08:00
parent ff8ba97918
commit 2ba2db3c5a
2 changed files with 4 additions and 3 deletions

View File

@@ -89,9 +89,8 @@ namespace MaaWpfGui.Helper
var etag = force ? string.Empty : Get(url);
Dictionary<string, string> headers = new Dictionary<string, string>
{
{
"Accept", "application/octet-stream"
},
{ "Accept", "application/octet-stream" },
{ "Connection", "close" },
};
if (!string.IsNullOrEmpty(etag))

View File

@@ -91,6 +91,8 @@ namespace MaaWpfGui.Services.Web
}
}
request.Headers.ConnectionClose = true;
var stopwatch = Stopwatch.StartNew();
var response = await _client.SendAsync(request).ConfigureAwait(false);
stopwatch.Stop();