mirror of
https://github.com/Wei-Shaw/claude-relay-service.git
synced 2026-01-23 00:53:33 +00:00
fix: 清理所有字符串字段的错误消息,不仅限于 message 字段
比如:error_message 字段
This commit is contained in:
@@ -65,7 +65,8 @@ function sanitizeUpstreamError(errorData) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (const key in obj) {
|
for (const key in obj) {
|
||||||
if (key === 'message' && typeof obj[key] === 'string') {
|
// 清理所有字符串字段,不仅仅是 message
|
||||||
|
if (typeof obj[key] === 'string') {
|
||||||
obj[key] = sanitizeErrorMessage(obj[key])
|
obj[key] = sanitizeErrorMessage(obj[key])
|
||||||
} else if (typeof obj[key] === 'object') {
|
} else if (typeof obj[key] === 'object') {
|
||||||
sanitizeObject(obj[key])
|
sanitizeObject(obj[key])
|
||||||
|
|||||||
Reference in New Issue
Block a user