Skip to content

Commit 781a173

Browse files
committed
Fix bug for digest authentication, qop may be String or List<dynamic>.
1 parent 33c0859 commit 781a173

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/src/digest_authentication.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class Challenge {
1414
String nonce;
1515
String opaque;
1616
bool stale;
17-
List<dynamic> qop;
17+
dynamic qop; // String or List<dynamic>
1818
}
1919

2020
class Credentials {

test/test_digest_authentication.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ List<void Function()> testFunctions = <void Function()>[
7474
'nonce': '5a071f75353f667787615249c62dcc7b15a4828f',
7575
'opaque': null,
7676
'stale': null,
77-
'qop': 'auth'
77+
'qop': ['auth']
7878
});
7979

8080
DigestAuthentication digest = DigestAuthentication(credentials);
@@ -84,7 +84,7 @@ List<void Function()> testFunctions = <void Function()>[
8484
expect(digest.response, 'a69b9c2ea0dea1437a21df6ddc9b05e4');
8585
}),
8686
() => test(
87-
'DigestAuthentication: digest authenticate qop = auth-int and empty body',
87+
'DigestAuthentication: digest authenticate qop = ["auth", "auth-int"] and empty body',
8888
() {
8989
SipMethod method = SipMethod.REGISTER;
9090
String ruri = 'sip:[email protected]';
@@ -101,7 +101,7 @@ List<void Function()> testFunctions = <void Function()>[
101101
'nonce': '5a071f75353f667787615249c62dcc7b15a4828f',
102102
'opaque': null,
103103
'stale': null,
104-
'qop': 'auth-int'
104+
'qop': ['auth', 'auth-int']
105105
});
106106

107107
DigestAuthentication digest = DigestAuthentication(credentials);

0 commit comments

Comments
 (0)