mirror of
https://github.com/aler9/gortsplib
synced 2025-10-06 15:46:51 +08:00
fix connection with axis servers
This commit is contained in:
@@ -24,6 +24,9 @@ func ReadHeaderSession(in string) (*HeaderSession, error) {
|
||||
hs.Session, parts = parts[0], parts[1:]
|
||||
|
||||
for _, part := range parts {
|
||||
// remove leading spaces
|
||||
part = strings.TrimLeft(part, " ")
|
||||
|
||||
keyval := strings.Split(part, "=")
|
||||
if len(keyval) != 2 {
|
||||
return nil, fmt.Errorf("invalid value")
|
||||
|
@@ -29,6 +29,17 @@ var casesHeaderSession = []struct {
|
||||
}(),
|
||||
},
|
||||
},
|
||||
{
|
||||
"with timeout and space",
|
||||
`A3eqwsafq3rFASqew; timeout=47`,
|
||||
&HeaderSession{
|
||||
Session: "A3eqwsafq3rFASqew",
|
||||
Timeout: func() *uint {
|
||||
v := uint(47)
|
||||
return &v
|
||||
}(),
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
func TestHeaderSession(t *testing.T) {
|
||||
|
Reference in New Issue
Block a user