mirror of
https://gitclone.com/github.com/MetaCubeX/Clash.Meta
synced 2025-02-23 12:42:27 +08:00
fix uuid match
This commit is contained in:
parent
b3295262c1
commit
a08e39faec
@ -7,10 +7,11 @@ import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"net"
|
||||
"regexp"
|
||||
|
||||
"github.com/Dreamacro/clash/component/dialer"
|
||||
C "github.com/Dreamacro/clash/constant"
|
||||
|
||||
"github.com/gofrs/uuid"
|
||||
)
|
||||
|
||||
type Base struct {
|
||||
@ -151,8 +152,8 @@ func newPacketConn(pc net.PacketConn, a C.ProxyAdapter) C.PacketConn {
|
||||
}
|
||||
|
||||
func uuidMap(str string) string {
|
||||
match, _ := regexp.MatchString(`[\da-f]{8}(-[\da-f]{4}){3}-[\da-f]{12}$`, str)
|
||||
if !match {
|
||||
_, err := uuid.FromString(str)
|
||||
if err != nil {
|
||||
var Nil [16]byte
|
||||
h := sha1.New()
|
||||
h.Write(Nil[:])
|
||||
|
Loading…
Reference in New Issue
Block a user