缓存预热判断请求来源的时候增加IPv6回路地址判断

This commit is contained in:
GoEdgeLab
2021-10-06 16:35:39 +08:00
parent 850752ff20
commit 6cab7a21ef

View File

@@ -24,7 +24,7 @@ func (this *HTTPRequest) doCacheRead() (shouldStop bool) {
}
// 判断是否在预热
if strings.HasPrefix(this.RawReq.RemoteAddr, "127.") && this.RawReq.Header.Get("X-Cache-Action") == "preheat" {
if (strings.HasPrefix(this.RawReq.RemoteAddr, "127.") || strings.HasPrefix(this.RawReq.RemoteAddr, "[::1]")) && this.RawReq.Header.Get("X-Cache-Action") == "preheat" {
return
}