mirror of
https://github.com/aler9/gortsplib
synced 2025-10-06 07:37:07 +08:00
header-auth: fix decoding of empty fields
This commit is contained in:
@@ -63,7 +63,7 @@ var casesHeaderAuth = []struct {
|
||||
},
|
||||
},
|
||||
{
|
||||
"digest response",
|
||||
"digest response 1",
|
||||
`Digest username="aa", realm="bb", nonce="cc", uri="dd", response="ee"`,
|
||||
`Digest realm="bb", nonce="cc", response="ee", uri="dd", username="aa"`,
|
||||
&HeaderAuth{
|
||||
@@ -77,6 +77,21 @@ var casesHeaderAuth = []struct {
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"digest response with empty field",
|
||||
`Digest username="", realm="IPCAM", nonce="5d17cd12b9fa8a85ac5ceef0926ea5a6", uri="rtsp://localhost:8554/mystream", response="c072ae90eb4a27f4cdcb90d62266b2a1"`,
|
||||
`Digest realm="IPCAM", nonce="5d17cd12b9fa8a85ac5ceef0926ea5a6", response="c072ae90eb4a27f4cdcb90d62266b2a1", uri="rtsp://localhost:8554/mystream", username=""`,
|
||||
&HeaderAuth{
|
||||
Prefix: "Digest",
|
||||
Values: map[string]string{
|
||||
"username": "",
|
||||
"realm": "IPCAM",
|
||||
"nonce": "5d17cd12b9fa8a85ac5ceef0926ea5a6",
|
||||
"uri": "rtsp://localhost:8554/mystream",
|
||||
"response": "c072ae90eb4a27f4cdcb90d62266b2a1",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
func TestHeaderAuthRead(t *testing.T) {
|
||||
|
Reference in New Issue
Block a user