防盗链功能增加“例外URL“和“限制URL”设置

This commit is contained in:
GoEdgeLab
2024-04-17 15:45:24 +08:00
parent 3cce95da45
commit 44e40b4615

View File

@@ -12,6 +12,11 @@ func (this *HTTPRequest) doCheckReferers() (shouldStop bool) {
return
}
// 检查URL
if !this.web.Referers.MatchURL(this.URL()) {
return
}
var origin = this.RawReq.Header.Get("Origin")
const cacheSeconds = "3600" // 时间不能过长,防止修改设置后长期无法生效