mirror of
https://github.com/aler9/gortsplib
synced 2025-10-06 23:52:46 +08:00
add new authentication header test; fix #1
This commit is contained in:
@@ -63,7 +63,7 @@ var casesHeaderAuth = []struct {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"digest response 1",
|
"digest response generic",
|
||||||
`Digest username="aa", realm="bb", nonce="cc", uri="dd", response="ee"`,
|
`Digest username="aa", realm="bb", nonce="cc", uri="dd", response="ee"`,
|
||||||
`Digest realm="bb", nonce="cc", response="ee", uri="dd", username="aa"`,
|
`Digest realm="bb", nonce="cc", response="ee", uri="dd", username="aa"`,
|
||||||
&HeaderAuth{
|
&HeaderAuth{
|
||||||
@@ -92,6 +92,21 @@ var casesHeaderAuth = []struct {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"digest response with no spaces and additional fields",
|
||||||
|
`Digest realm="Please log in with a valid username",nonce="752a62306daf32b401a41004555c7663",opaque="",stale=FALSE,algorithm=MD5`,
|
||||||
|
`Digest realm="Please log in with a valid username", algorithm="MD5", nonce="752a62306daf32b401a41004555c7663", opaque="", stale="FALSE"`,
|
||||||
|
&HeaderAuth{
|
||||||
|
Prefix: "Digest",
|
||||||
|
Values: map[string]string{
|
||||||
|
"realm": "Please log in with a valid username",
|
||||||
|
"nonce": "752a62306daf32b401a41004555c7663",
|
||||||
|
"opaque": "",
|
||||||
|
"stale": "FALSE",
|
||||||
|
"algorithm": "MD5",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestHeaderAuthRead(t *testing.T) {
|
func TestHeaderAuthRead(t *testing.T) {
|
||||||
|
Reference in New Issue
Block a user