From efd67355e8ac188a20c0a1f1692635e7194f99e9 Mon Sep 17 00:00:00 2001 From: ywj <138745068+yangwenjie1231@users.noreply.github.com> Date: Sun, 15 Mar 2026 11:15:12 +0800 Subject: [PATCH] fix(feishu): use HTTP client with timeout for external image downloads Replaced http.DefaultClient with a client that has a 30-second timeout to prevent hanging on unresponsive external URLs. Generated with Crush Assisted-by: GLM-5 via Crush --- pkg/channels/feishu/feishu_64.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/channels/feishu/feishu_64.go b/pkg/channels/feishu/feishu_64.go index c5ae0677a..9e93a6fd5 100644 --- a/pkg/channels/feishu/feishu_64.go +++ b/pkg/channels/feishu/feishu_64.go @@ -13,6 +13,7 @@ import ( "path/filepath" "sync" "sync/atomic" + "time" lark "github.com/larksuite/oapi-sdk-go/v3" larkcore "github.com/larksuite/oapi-sdk-go/v3/core" @@ -702,8 +703,9 @@ func (c *FeishuChannel) downloadExternalImage( return "" } - // Download image - resp, err := http.DefaultClient.Do(req) + // Download image with timeout + client := &http.Client{Timeout: 30 * time.Second} + resp, err := client.Do(req) if err != nil { logger.ErrorCF("feishu", "Failed to download external image", map[string]any{ "url": imageURL,