修复:增加检查accept-ranges头是否为为bytes

检查返回内容,accept-ranges头,如果为bytes,则表示支持断点续传,是静态资源
This commit is contained in:
954437801
2025-10-10 20:47:08 +08:00
committed by GitHub
parent 13f33a6603
commit ca8e7b9475

View File

@@ -177,6 +177,11 @@ func IsStaticAssist(res *http.Response, contentType string) bool {
zlog.Debug(fmt.Sprintf("检测到附件 %s", res.Request.URL.String()))
return true
}
// 检查返回内容accept-ranges头如果为bytes则表示支持断点续传是静态资源
acceptRanges := res.Header.Get("Accept-Ranges")
if acceptRanges == "bytes" {
return true
}
// 检查请求的Accept头判断是否为资源类型请求
if res.Request != nil {
// 检查Sec-Fetch-Dest头这是一个更明确的指示