From c1241a98e2799f1cc722d0a78b592b599e86cab2 Mon Sep 17 00:00:00 2001 From: RGBadmin Date: Sun, 15 Mar 2026 23:00:17 +0800 Subject: [PATCH] fix(api): restrict fallback note to string-typed JSON values Only emit note in listAuthFilesFromDisk when the JSON value is actually a string (gjson.String), matching the synthesizer/buildAuthFileEntry behavior. Non-string values like numbers or booleans are now ignored instead of being coerced via gjson.String(). Co-Authored-By: Claude Opus 4.6 --- internal/api/handlers/management/auth_files.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/api/handlers/management/auth_files.go b/internal/api/handlers/management/auth_files.go index 176f82979..4d1ec44cf 100644 --- a/internal/api/handlers/management/auth_files.go +++ b/internal/api/handlers/management/auth_files.go @@ -342,7 +342,7 @@ func (h *Handler) listAuthFilesFromDisk(c *gin.Context) { } } } - if nv := gjson.GetBytes(data, "note"); nv.Exists() { + if nv := gjson.GetBytes(data, "note"); nv.Exists() && nv.Type == gjson.String { if trimmed := strings.TrimSpace(nv.String()); trimmed != "" { fileData["note"] = trimmed }