switch to v5 (#890)

* switch from v4 to v5

* remove deprecated entities

* remove "2" suffix from entities

* rename TransportProtocol into Protocol
This commit is contained in:
Alessandro Ros
2025-09-16 11:46:52 +02:00
committed by GitHub
parent f8649f6cf1
commit ec81d388d1
173 changed files with 805 additions and 2615 deletions

View File

@@ -5,7 +5,7 @@ import (
"fmt"
"strings"
"github.com/bluenviron/gortsplib/v4/pkg/base"
"github.com/bluenviron/gortsplib/v5/pkg/base"
)
// Authorization is an Authorization header.
@@ -20,11 +20,6 @@ type Authorization struct {
// Basic authentication fields
//
// user
//
// Deprecated: replaced by Username.
BasicUser string
// password
BasicPass string
@@ -92,7 +87,6 @@ func (h *Authorization) Unmarshal(v base.HeaderValue) error {
}
h.Username, h.BasicPass = tmp2[0], tmp2[1]
h.BasicUser = h.Username
} else { // digest
kvs, err := keyValParse(v0, ',')
if err != nil {
@@ -153,9 +147,6 @@ func (h *Authorization) Unmarshal(v base.HeaderValue) error {
// Marshal encodes an Authorization header.
func (h Authorization) Marshal() base.HeaderValue {
if h.Method == AuthMethodBasic {
if h.BasicUser != "" {
h.Username = h.BasicUser
}
return base.HeaderValue{"Basic " +
base64.StdEncoding.EncodeToString([]byte(h.Username+":"+h.BasicPass))}
}