From 2ba2db3c5ad2e51d719e9fffa871e8735ed12a36 Mon Sep 17 00:00:00 2001 From: ChingCdesu Date: Wed, 10 Jul 2024 10:08:57 +0800 Subject: [PATCH] =?UTF-8?q?pref:=20=E5=B0=86Head=E5=92=8CETag=E8=AF=B7?= =?UTF-8?q?=E6=B1=82=E8=AE=BE=E7=BD=AE=E4=B8=BA`Connection:=20close`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/MaaWpfGui/Helper/ETagCache.cs | 5 ++--- src/MaaWpfGui/Services/Web/HttpService.cs | 2 ++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/MaaWpfGui/Helper/ETagCache.cs b/src/MaaWpfGui/Helper/ETagCache.cs index 9f44669890..52c0dc0bda 100644 --- a/src/MaaWpfGui/Helper/ETagCache.cs +++ b/src/MaaWpfGui/Helper/ETagCache.cs @@ -89,9 +89,8 @@ namespace MaaWpfGui.Helper var etag = force ? string.Empty : Get(url); Dictionary headers = new Dictionary { - { - "Accept", "application/octet-stream" - }, + { "Accept", "application/octet-stream" }, + { "Connection", "close" }, }; if (!string.IsNullOrEmpty(etag)) diff --git a/src/MaaWpfGui/Services/Web/HttpService.cs b/src/MaaWpfGui/Services/Web/HttpService.cs index cf65b416f6..a956556f6f 100644 --- a/src/MaaWpfGui/Services/Web/HttpService.cs +++ b/src/MaaWpfGui/Services/Web/HttpService.cs @@ -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();