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 <noreply@anthropic.com>
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user