修复规则优先级问题,修复添加自定义规则后需要重启服务器的问题

This commit is contained in:
Alex Yang
2025-12-21 21:11:58 +08:00
parent b2ec6c88a7
commit 30d47da022
16 changed files with 410 additions and 336 deletions

View File

@@ -832,6 +832,9 @@ func (s *Server) handleShield(w http.ResponseWriter, r *http.Request) {
return
}
// 清空DNS缓存使新规则立即生效
s.dnsServer.DnsCache.Clear()
json.NewEncoder(w).Encode(map[string]string{"status": "success"})
return
case http.MethodDelete:
@@ -850,6 +853,9 @@ func (s *Server) handleShield(w http.ResponseWriter, r *http.Request) {
return
}
// 清空DNS缓存使规则变更立即生效
s.dnsServer.DnsCache.Clear()
json.NewEncoder(w).Encode(map[string]string{"status": "success"})
return
case http.MethodPut: