From 6dbb5c98ccb0f8c97a9947575d6e6d7e568be47f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=96=84=E5=A5=9A=E6=A2=A6=E7=81=B5?= Date: Sat, 7 Jun 2025 14:18:00 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=B0=91=E4=BA=86=E7=89=B9=E5=AE=9A?= =?UTF-8?q?=E6=A0=87=E5=A4=B4=E5=92=8C=E5=BC=82=E5=B8=B8=E6=8A=9B=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CO-Authored-By: baiyuexiao496 --- Plain Craft Launcher 2/Modules/Base/ModNet.vb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Plain Craft Launcher 2/Modules/Base/ModNet.vb b/Plain Craft Launcher 2/Modules/Base/ModNet.vb index 6e3ab5c..9a8f190 100644 --- a/Plain Craft Launcher 2/Modules/Base/ModNet.vb +++ b/Plain Craft Launcher 2/Modules/Base/ModNet.vb @@ -275,6 +275,8 @@ Retry: {"Accept", Accept} } Using Req As HttpRequestMessage = Request.GetRequestMessage(Url, Headers:=Headers, RequireHeaderSign:=True, RequireCdnSign:=True, UseBrowserUA:=UseBrowserUserAgent) + Req.Headers.AcceptLanguage.Add(New StringWithQualityHeaderValue("en-US,en;q=0.5")) + Req.Headers.TryAddWithoutValidation("X-Request-With","XMLHttpRequest") Dim Resp As String = Request.SendRequest(Req, Encode:=Encoding, Timeout:=Timeout) Return Resp @@ -1250,7 +1252,7 @@ StartThread: Throw New Exception($"文件大小不足,获取结果为 {ContentLength},要求至少为 {Check.MinSize}。") End If If ContentLength <> Check.ActualSize AndAlso Check.ActualSize > 0 Then - 'Throw New Exception($"文件大小不一致,获取结果为 {ContentLength},要求必须为 {Check.ActualSize}。") + Throw New Exception($"文件大小不一致,获取结果为 {ContentLength},要求必须为 {Check.ActualSize}。") End If End If FileSize = ContentLength : IsUnknownSize = False @@ -1281,9 +1283,9 @@ NotSupportRange: Throw New WebException($"该下载源不支持分段下载:Range 起始于 {Info.DownloadStart},预期 ContentLength 为 {FileSize - Info.DownloadStart},返回 ContentLength 为 {ContentLength},总文件大小 {FileSize}") ElseIf Not FileSize - Info.DownloadStart = ContentLength Then - 'Throw New WebException($"获取到的分段大小不一致:Range 起始于 {Info.DownloadStart},预期 ContentLength 为 {FileSize - Info.DownloadStart},返回 ContentLength 为 {ContentLength},总文件大小 {FileSize}") + Throw New WebException($"获取到的分段大小不一致:Range 起始于 {Info.DownloadStart},预期 ContentLength 为 {FileSize - Info.DownloadStart},返回 ContentLength 为 {ContentLength},总文件大小 {FileSize}") End If - 'Log($"[Download] {LocalName} {Info.Uuid}#:通过大小检查,文件大小 {FileSize},起始点 {Info.DownloadStart},ContentLength {ContentLength}") + Log($"[Download] {LocalName} {Info.Uuid}#:通过大小检查,文件大小 {FileSize},起始点 {Info.DownloadStart},ContentLength {ContentLength}") Info.State = NetState.Get SyncLock LockState If State < NetState.Get Then State = NetState.Get