mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2025-01-07 09:53:58 +08:00
fix: dns cache index out of range
This commit is contained in:
parent
259f900c3f
commit
79bd67a6c4
@ -29,9 +29,11 @@ const (
|
||||
|
||||
func putMsgToCache(c *cache.LruCache[string, *D.Msg], key string, msg *D.Msg) {
|
||||
// skip dns cache for acme challenge
|
||||
if q := msg.Question[0]; q.Qtype == D.TypeTXT && strings.HasPrefix(q.Name, "_acme-challenge") {
|
||||
log.Debugln("[DNS] dns cache ignored because of acme challenge for: %s", q.Name)
|
||||
return
|
||||
if len(msg.Question) != 0 {
|
||||
if q := msg.Question[0]; q.Qtype == D.TypeTXT && strings.HasPrefix(q.Name, "_acme-challenge") {
|
||||
log.Debugln("[DNS] dns cache ignored because of acme challenge for: %s", q.Name)
|
||||
return
|
||||
}
|
||||
}
|
||||
var ttl uint32
|
||||
switch {
|
||||
|
Loading…
x
Reference in New Issue
Block a user