lobe-chat
lobe-chat copied to clipboard
[Request] 删除当openai出现err时候出现的endpoint敏感信息
🥰 需求描述 | Feature Description
当用户配置自定义的openai的endpoint的时候,出现了例如rate limit,或者额度不足的时候会在前端页面暴露后端设置的endpoint,建议隐藏endpoint 的url,容易被恶意攻击
🧐 解决方案 | Proposed Solution
我看了下改下这里的代码应该就可以了,【可能还有其他地方】
https://github.com/lobehub/lobe-chat/blob/main/src/app/api/openai/chat/createChatCompletion.ts
return createErrorResponse(ChatErrorType.OpenAIBizError, {
endpoint: openai.baseURL,
error: errorResult,
});
}
// track the non-openai error
console.error(error);
// return as a GatewayTimeout error
return createErrorResponse(ChatErrorType.InternalServerError, {
endpoint: openai.baseURL,
error: JSON.stringify(error),
});
}
};
📝 补充信息 | Additional Information
No response
👀 @CaoYunzhou
Thank you for raising an issue. We will investigate into the matter and get back to you as soon as possible.
Please make sure you have given us as much context as possible.
非常感谢您提交 issue。我们会尽快调查此事,并尽快回复您。 请确保您已经提供了尽可能多的背景信息。
✅ @CaoYunzhou
This issue is closed, If you have any questions, you can comment and reply.
此问题已经关闭。如果您有任何问题,可以留言并回复。
:tada: This issue has been resolved in version 0.118.7 :tada:
The release is available on:
Your semantic-release bot :package::rocket: