mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-09 14:50:56 +00:00
strings.TrimLeft is not actually TrimPrefix
This commit is contained in:
parent
45631d30b0
commit
e6866ee980
@ -255,7 +255,7 @@ func parseResponse(deviceType string, resp []byte) (IGD, error) {
|
|||||||
return IGD{}, errors.New("invalid IGD response: USN not specified")
|
return IGD{}, errors.New("invalid IGD response: USN not specified")
|
||||||
}
|
}
|
||||||
|
|
||||||
deviceUUID := strings.TrimLeft(strings.Split(deviceUSN, "::")[0], "uuid:")
|
deviceUUID := strings.TrimPrefix(strings.Split(deviceUSN, "::")[0], "uuid:")
|
||||||
matched, err := regexp.MatchString("[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", deviceUUID)
|
matched, err := regexp.MatchString("[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", deviceUUID)
|
||||||
if !matched {
|
if !matched {
|
||||||
l.Infoln("Invalid IGD response: invalid device UUID", deviceUUID, "(continuing anyway)")
|
l.Infoln("Invalid IGD response: invalid device UUID", deviceUUID, "(continuing anyway)")
|
||||||
|
Loading…
Reference in New Issue
Block a user