mirror of
https://github.com/linux-do/new-api.git
synced 2025-11-09 07:33:41 +08:00
feat: 进一步防止暴露数上游以及数据库地址
This commit is contained in:
@@ -29,7 +29,7 @@ func MidjourneyErrorWithStatusCodeWrapper(code int, desc string, statusCode int)
|
|||||||
func OpenAIErrorWrapper(err error, code string, statusCode int) *dto.OpenAIErrorWithStatusCode {
|
func OpenAIErrorWrapper(err error, code string, statusCode int) *dto.OpenAIErrorWithStatusCode {
|
||||||
text := err.Error()
|
text := err.Error()
|
||||||
// 定义一个正则表达式匹配URL
|
// 定义一个正则表达式匹配URL
|
||||||
if strings.Contains(text, "Post") {
|
if strings.Contains(text, "Post") || strings.Contains(text, "dial") {
|
||||||
common.SysLog(fmt.Sprintf("error: %s", text))
|
common.SysLog(fmt.Sprintf("error: %s", text))
|
||||||
text = "请求上游地址失败"
|
text = "请求上游地址失败"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user