From 98c9073f0dab4270b9a18c8705d67f50d0cbd48e Mon Sep 17 00:00:00 2001 From: lixiangwuxian Date: Fri, 11 Apr 2025 00:51:01 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=9C=A8=20fetchSelf=20=E5=87=BD?= =?UTF-8?q?=E6=95=B0=E4=B8=AD=E5=88=9D=E5=A7=8B=E5=8C=96=20reply=20?= =?UTF-8?q?=E5=8F=98=E9=87=8F=E4=BB=A5=E7=A1=AE=E4=BF=9D=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E5=80=BC=E7=9A=84=E6=AD=A3=E7=A1=AE=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- handler/fetchself/fetch.go | 1 + util/url.go | 6 +----- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/handler/fetchself/fetch.go b/handler/fetchself/fetch.go index 86bc22f..e854842 100644 --- a/handler/fetchself/fetch.go +++ b/handler/fetchself/fetch.go @@ -95,6 +95,7 @@ func fetchSelf(msg model.Message) (reply *model.Reply) { log.Println("parseSystemInfo failed", err) return } + reply = &model.Reply{} reply.FromMsg = msg reply.ReplyMsg = info.String() return diff --git a/util/url.go b/util/url.go index 8d361a5..6dcccaf 100644 --- a/util/url.go +++ b/util/url.go @@ -2,7 +2,6 @@ package util import ( "bytes" - "crypto/tls" "fmt" "io" "net/url" @@ -72,10 +71,7 @@ func DownloadFile(urlStr string, dirPath string) (filepath string, err error) { ReadTimeout: 30 * time.Second, WriteTimeout: 30 * time.Second, MaxConnWaitTimeout: 30 * time.Second, - // TLSConfig: nil, // 使用默认配置 - TLSConfig: &tls.Config{ - InsecureSkipVerify: true, - }, + TLSConfig: nil, } // 准备请求