Update scan.go

This commit is contained in:
公明 2025-03-03 11:27:16 +08:00 committed by GitHub
parent a732af55c7
commit 5184c53628
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -123,7 +123,7 @@ func sendHTTPAndKimi(r *RequestResponseLog) (result string, respA string, respB
Path: r.Request.URL.Path,
RawQuery: r.Request.URL.RawQuery,
}
fmt.Println(fullURL)
if isNotSuffix(r.Request.URL.Path, config.GetConfig().Suffixes) && !containsString(r.Response.Header.Get("Content-Type"), config.GetConfig().AllowedRespHeaders) {
req, err := http.NewRequest(r.Request.Method, fullURL.String(), strings.NewReader(string(r.Request.Body)))
@ -157,7 +157,7 @@ func sendHTTPAndKimi(r *RequestResponseLog) (result string, respA string, respB
resp2 := string(bodyBytes)
if len(resp1+resp2) < 65535 {
if !MatchString(config.GetConfig().RespBodyBWhiteList, resp2) {
// 初始值
var resultDetect string
var detectErr error
@ -178,6 +178,10 @@ func sendHTTPAndKimi(r *RequestResponseLog) (result string, respA string, respB
}
return resultDetect, resp1, resp2, nil
} else {
return `{"res": "false", "reason": "匹配到关键字判断为无越权未消耗AI tokens"}`, resp1, resp2, nil
}
} else {
return `{"res": "white", "reason": "请求包太大"}`, resp1, resp2, nil
}