fix: 短信接口按页面 JSONP 解析并原样提交票据

This commit is contained in:
Nixevol
2026-10-16 17:19:49 +08:00
parent 26ab215890
commit ef33ed166c
6 changed files with 129 additions and 24 deletions
+4 -1
View File
@@ -49,7 +49,7 @@ func debugHTTP(req *http.Request, resp *http.Response, buf []byte, reqErr error)
func debugSkipBody(req *http.Request, ctype string, buf []byte) bool {
ct := strings.ToLower(ctype)
path := strings.ToLower(req.URL.Path)
if strings.Contains(ct, "image") || strings.Contains(ct, "javascript") || strings.Contains(ct, "text/css") {
if strings.Contains(ct, "image") || strings.Contains(ct, "text/css") {
return true
}
switch {
@@ -58,6 +58,9 @@ func debugSkipBody(req *http.Request, ctype string, buf []byte) bool {
strings.HasSuffix(path, ".html"):
return true
}
if strings.Contains(ct, "javascript") && len(buf) > 8000 {
return true
}
trim := strings.TrimSpace(string(buf))
return strings.HasPrefix(trim, "<")
}