mirror of
https://github.com/aler9/gortsplib
synced 2025-10-06 15:46:51 +08:00
restore API compatibility
This commit is contained in:
@@ -10,8 +10,8 @@ import (
|
||||
"github.com/bluenviron/gortsplib/v3/pkg/url"
|
||||
)
|
||||
|
||||
// GenerateNonce generates a nonce that can be used in Validate().
|
||||
func GenerateNonce() (string, error) {
|
||||
// GenerateNonce2 generates a nonce that can be used in Validate().
|
||||
func GenerateNonce2() (string, error) {
|
||||
byts := make([]byte, 16)
|
||||
_, err := rand.Read(byts)
|
||||
if err != nil {
|
||||
@@ -21,6 +21,17 @@ func GenerateNonce() (string, error) {
|
||||
return hex.EncodeToString(byts), nil
|
||||
}
|
||||
|
||||
// GenerateNonce generates a nonce that can be used in Validate().
|
||||
//
|
||||
// Deprecated: use GenerateNonce2.
|
||||
func GenerateNonce() string {
|
||||
v, err := GenerateNonce2()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return v
|
||||
}
|
||||
|
||||
// GenerateWWWAuthenticate generates a WWW-Authenticate header.
|
||||
func GenerateWWWAuthenticate(methods []headers.AuthMethod, realm string, nonce string) base.HeaderValue {
|
||||
if methods == nil {
|
||||
|
Reference in New Issue
Block a user