mirror of
https://github.com/SunBK201/UA3F.git
synced 2025-12-16 16:57:08 +00:00
fix: replace slices.Contains with manual iteration for whitelist check
This commit is contained in:
parent
e34de96116
commit
1ce1d4a401
@ -7,7 +7,6 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"net"
|
"net"
|
||||||
"slices"
|
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@ -446,8 +445,11 @@ func CopyPileline(dst io.Writer, src io.Reader, destAddrPort string) {
|
|||||||
isMatchUaPattern = true
|
isMatchUaPattern = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if slices.Contains(whitelist, uaStr) {
|
for _, v := range whitelist {
|
||||||
isInWhiteList = true
|
if v == uaStr {
|
||||||
|
isInWhiteList = true
|
||||||
|
break
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if isInWhiteList || !isMatchUaPattern {
|
if isInWhiteList || !isMatchUaPattern {
|
||||||
if !isMatchUaPattern {
|
if !isMatchUaPattern {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user