From 93e475f3a423eda0bc7880b8f6d8fd19e3970c4a Mon Sep 17 00:00:00 2001 From: Alexey Khit Date: Wed, 13 Sep 2023 18:08:57 +0300 Subject: [PATCH] Fix support ONVIF client with line breaks #638 --- pkg/onvif/helpers.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/onvif/helpers.go b/pkg/onvif/helpers.go index b94305a4..fb65ecaf 100644 --- a/pkg/onvif/helpers.go +++ b/pkg/onvif/helpers.go @@ -1,16 +1,17 @@ package onvif import ( - "github.com/AlexxIT/go2rtc/pkg/core" "net" "regexp" "strconv" "strings" "time" + + "github.com/AlexxIT/go2rtc/pkg/core" ) func FindTagValue(b []byte, tag string) string { - re := regexp.MustCompile(`<[^/>]*` + tag + `[^>]*>([^<]+)`) + re := regexp.MustCompile(`(?s)<[^/>]*` + tag + `[^>]*>([^<]+)`) m := re.FindSubmatch(b) if len(m) != 2 { return ""