Merge pull request #476 from 954437801/loong64

修复:增加检查accept-ranges头是否为为bytes
This commit is contained in:
samwafgo
2025-10-13 13:59:21 +08:00
committed by GitHub

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头这是一个更明确的指示