mirror of
https://github.com/aler9/gortsplib
synced 2025-10-17 20:51:09 +08:00
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:
@@ -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))}
|
||||
}
|
||||
|
Reference in New Issue
Block a user