mirror of
https://github.com/aler9/rtsp-simple-server
synced 2025-10-03 06:52:17 +08:00
27 lines
438 B
Go
27 lines
438 B
Go
package rtsp
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/bluenviron/gortsplib/v5/pkg/base"
|
|
"github.com/bluenviron/mediamtx/internal/auth"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestCredentials(t *testing.T) {
|
|
rr := &base.Request{
|
|
Header: base.Header{
|
|
"Authorization": []string{
|
|
"Basic bXl1c2VyOm15cGFzcw==",
|
|
},
|
|
},
|
|
}
|
|
|
|
c := Credentials(rr)
|
|
|
|
require.Equal(t, &auth.Credentials{
|
|
User: "myuser",
|
|
Pass: "mypass",
|
|
}, c)
|
|
}
|