Closed ye4293 closed 3 days ago
确实,是我考虑欠妥了。确实应该注意恶意请求这个问题。
Buer @.***> 于2024年6月23日周日 17:17写道:
@.**** requested changes on this pull request.
In monitor/manage.go https://github.com/songquanpeng/one-api/pull/1549#discussion_r1650026027 :
@@ -35,6 +36,8 @@ func ShouldDisableChannel(err *model.Error, statusCode int) bool { return true } else if strings.HasPrefix(err.Message, "This organization has been disabled.") { return true
- } else if strings.HasPrefix(err.Message, "无可用渠道") {
- 这个匹配不到,要用HasSuffix
- 模型不存在,不应该被禁用,这个不合理,有可能是不小心填写错误,如果商用,也可以被恶意请求,导致上游渠道全部被禁用。
— Reply to this email directly, view it on GitHub https://github.com/songquanpeng/one-api/pull/1549#pullrequestreview-2134225362, or unsubscribe https://github.com/notifications/unsubscribe-auth/BAVUTO6KRVRDCEX32IQMMJTZI2HCDAVCNFSM6AAAAABJVDK3MKVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDCMZUGIZDKMZWGI . You are receiving this because you authored the thread.Message ID: @.***>
这种确实利用错误统计会更好点,不应该直接ban掉渠道。
Buer @.***> 于2024年6月23日周日 22:19写道:
@.**** commented on this pull request.
In monitor/manage.go https://github.com/songquanpeng/one-api/pull/1549#discussion_r1650086550 :
@@ -35,6 +36,8 @@ func ShouldDisableChannel(err *model.Error, statusCode int) bool { return true } else if strings.HasPrefix(err.Message, "This organization has been disabled.") { return true
- } else if strings.HasPrefix(err.Message, "无可用渠道") {
我看你的返回错误 是他把4o下了,这种情况还真没有啥好预防的措施。因为报错是正常报错,没有特征可以识别。 你只能自己关注,要么可以自己写一个错误统计的,某个错误一定时间内超过多少条,发消息给你,你自己手动处理。
— Reply to this email directly, view it on GitHub https://github.com/songquanpeng/one-api/pull/1549#discussion_r1650086550, or unsubscribe https://github.com/notifications/unsubscribe-auth/BAVUTO35OK4232H4OB47Y5LZI3KPFAVCNFSM6AAAAABJVDK3MKVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDCMZUGI4TCMZUGQ . You are receiving this because you authored the thread.Message ID: @.***>
close #1548 #1494
我已确认该 PR 已自测通过,相关截图如下: (此处放上测试通过的截图,如果不涉及前端改动或从 UI 上无法看出,请放终端启动成功的截图)