mirror of
https://github.com/bluenviron/mediamtx.git
synced 2025-12-20 02:00:05 -08:00
Some checks failed
code_lint / go (push) Has been cancelled
code_lint / go_mod (push) Has been cancelled
code_lint / docs (push) Has been cancelled
code_lint / api_docs (push) Has been cancelled
code_test / test_64 (push) Has been cancelled
code_test / test_32 (push) Has been cancelled
code_test / test_e2e (push) Has been cancelled
26 lines
438 B
Go
26 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)
|
|
}
|