fix: 清理所有字符串字段的错误消息,不仅限于 message 字段

比如:error_message 字段
This commit is contained in:
sususu98
2025-10-28 10:06:26 +08:00
parent 3abd0b0f36
commit 42fc164fa4

View File

@@ -65,7 +65,8 @@ function sanitizeUpstreamError(errorData) {
}
for (const key in obj) {
if (key === 'message' && typeof obj[key] === 'string') {
// 清理所有字符串字段,不仅仅是 message
if (typeof obj[key] === 'string') {
obj[key] = sanitizeErrorMessage(obj[key])
} else if (typeof obj[key] === 'object') {
sanitizeObject(obj[key])