From 1a9d1fff8391e531b0af6b6b32f0ae0ee86e057a Mon Sep 17 00:00:00 2001 From: hermes Date: Mon, 26 Oct 2026 16:03:52 +0800 Subject: [PATCH] =?UTF-8?q?fix(qa):=20=E7=9C=8B=E6=9D=BF=E9=99=84=E5=9B=BE?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=94=B9=E7=94=A8=E5=A4=A7=E8=AF=B7=E6=B1=82?= =?UTF-8?q?=E4=BD=93=E8=A7=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 附图 base64 远超 64KiB 的质量编辑上限,被误判为无效设置并报“发送设置无效”。 改为 12MB 上限的通用解码,并返回明确的图片错误文案。 --- internal/httpapi/qa_weekly_mail.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/httpapi/qa_weekly_mail.go b/internal/httpapi/qa_weekly_mail.go index f3b1e46..05a1daf 100644 --- a/internal/httpapi/qa_weekly_mail.go +++ b/internal/httpapi/qa_weekly_mail.go @@ -192,8 +192,9 @@ func qaWeeklyMailImage(w http.ResponseWriter, r *http.Request, c Config) { var request struct { PNGBase64 string `json:"png_base64"` } - if decodeQualityJSON(w, r, &request) != nil { - weeklyMailError(w, qawemail.ErrInvalid) + // The chart is megabytes of base64, far above the tiny quality-edit limit. + if decodeGovernanceJSON(w, r, &request, 12<<20) != nil { + writeJSON(w, http.StatusBadRequest, map[string]string{"error": "看板图片数据无效或过大(上限 8MB)"}) return } png, err := base64.StdEncoding.DecodeString(request.PNGBase64)