Fix support ONVIF client with line breaks #638
This commit is contained in:
@@ -1,16 +1,17 @@
|
|||||||
package onvif
|
package onvif
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/AlexxIT/go2rtc/pkg/core"
|
|
||||||
"net"
|
"net"
|
||||||
"regexp"
|
"regexp"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/AlexxIT/go2rtc/pkg/core"
|
||||||
)
|
)
|
||||||
|
|
||||||
func FindTagValue(b []byte, tag string) string {
|
func FindTagValue(b []byte, tag string) string {
|
||||||
re := regexp.MustCompile(`<[^/>]*` + tag + `[^>]*>([^<]+)`)
|
re := regexp.MustCompile(`(?s)<[^/>]*` + tag + `[^>]*>([^<]+)`)
|
||||||
m := re.FindSubmatch(b)
|
m := re.FindSubmatch(b)
|
||||||
if len(m) != 2 {
|
if len(m) != 2 {
|
||||||
return ""
|
return ""
|
||||||
|
|||||||
Reference in New Issue
Block a user