Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion app/dns/dns.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ package dns
import (
"context"
"fmt"
"sort"
"strings"
"sync"

Expand Down Expand Up @@ -250,7 +251,11 @@ func (s *DNS) sortClients(domain string) []*Client {

// Priority domain matching
hasMatch := false
for _, match := range s.domainMatcher.Match(domain) {
MatchSlice := s.domainMatcher.Match(domain)
sort.Slice(MatchSlice, func(i, j int) bool {
return MatchSlice[i] < MatchSlice[j]
})
for _, match := range MatchSlice {
info := s.matcherInfos[match]
client := s.clients[info.clientIdx]
domainRule := client.domains[info.domainRuleIdx]
Expand Down