Fix support ONVIF client with line breaks #638

This commit is contained in:
Alexey Khit
2023-09-13 18:08:57 +03:00
parent e5d8170037
commit 93e475f3a4
+3 -2
View File
@@ -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 ""