Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Request] 删除当openai出现err时候出现的endpoint敏感信息 #842

Closed
CaoYunzhou opened this issue Dec 28, 2023 · 3 comments · Fixed by #918
Closed

[Request] 删除当openai出现err时候出现的endpoint敏感信息 #842

CaoYunzhou opened this issue Dec 28, 2023 · 3 comments · Fixed by #918
Labels
🌠 Feature Request New feature or request | 特性与建议 released

Comments

@CaoYunzhou
Copy link

🥰 需求描述 | 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 CaoYunzhou added the 🌠 Feature Request New feature or request | 特性与建议 label Dec 28, 2023
@lobehubbot
Copy link
Member

👀 @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。我们会尽快调查此事,并尽快回复您。 请确保您已经提供了尽可能多的背景信息。

@lobehubbot
Copy link
Member

@CaoYunzhou

This issue is closed, If you have any questions, you can comment and reply.
此问题已经关闭。如果您有任何问题,可以留言并回复。

@lobehubbot
Copy link
Member

🎉 This issue has been resolved in version 0.118.7 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌠 Feature Request New feature or request | 特性与建议 released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants