diff --git a/header-auth_test.go b/header-auth_test.go index 3b525a57..c7740458 100644 --- a/header-auth_test.go +++ b/header-auth_test.go @@ -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 realm="bb", nonce="cc", response="ee", uri="dd", username="aa"`, &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) {