mirror of
https://github.com/aler9/gortsplib
synced 2025-10-07 16:10:59 +08:00
use HeaderValue instead of []string; edit ReadHeaderAuth(), ReadHeaderSession(), ReadHeaderTransport() to accept HeaderValue
This commit is contained in:
@@ -13,8 +13,16 @@ type HeaderSession struct {
|
||||
}
|
||||
|
||||
// ReadHeaderSession parses a Session header.
|
||||
func ReadHeaderSession(in string) (*HeaderSession, error) {
|
||||
parts := strings.Split(in, ";")
|
||||
func ReadHeaderSession(v HeaderValue) (*HeaderSession, error) {
|
||||
if len(v) == 0 {
|
||||
return nil, fmt.Errorf("value not provided")
|
||||
}
|
||||
|
||||
if len(v) > 1 {
|
||||
return nil, fmt.Errorf("value provided multiple times (%v)", v)
|
||||
}
|
||||
|
||||
parts := strings.Split(v[0], ";")
|
||||
if len(parts) == 0 {
|
||||
return nil, fmt.Errorf("invalid value")
|
||||
}
|
||||
|
Reference in New Issue
Block a user