mirror of
https://gitee.com/samwaf/SamWaf.git
synced 2025-12-06 14:59:18 +08:00
修复:增加检查accept-ranges头是否为为bytes
检查返回内容,accept-ranges头,如果为bytes,则表示支持断点续传,是静态资源
This commit is contained in:
@@ -177,6 +177,11 @@ func IsStaticAssist(res *http.Response, contentType string) bool {
|
|||||||
zlog.Debug(fmt.Sprintf("检测到附件 %s", res.Request.URL.String()))
|
zlog.Debug(fmt.Sprintf("检测到附件 %s", res.Request.URL.String()))
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
// 检查返回内容,accept-ranges头,如果为bytes,则表示支持断点续传,是静态资源
|
||||||
|
acceptRanges := res.Header.Get("Accept-Ranges")
|
||||||
|
if acceptRanges == "bytes" {
|
||||||
|
return true
|
||||||
|
}
|
||||||
// 检查请求的Accept头,判断是否为资源类型请求
|
// 检查请求的Accept头,判断是否为资源类型请求
|
||||||
if res.Request != nil {
|
if res.Request != nil {
|
||||||
// 检查Sec-Fetch-Dest头,这是一个更明确的指示
|
// 检查Sec-Fetch-Dest头,这是一个更明确的指示
|
||||||
|
|||||||
Reference in New Issue
Block a user