drachtio-srf 5.0.25 → 5.0.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/digest-client.js +7 -4
- package/package.json +1 -1
package/lib/digest-client.js
CHANGED
|
@@ -162,10 +162,13 @@ module.exports = class DigestClient {
|
|
|
162
162
|
_parseChallenge(digest) {
|
|
163
163
|
const params = {};
|
|
164
164
|
if (typeof digest !== 'string') return params;
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
165
|
+
// RFC 7235 §2.1: the auth-scheme token is case-insensitive. Some SBCs
|
|
166
|
+
// (e.g. BroadWorks) send "DIGEST"; a case-sensitive match on "Digest "
|
|
167
|
+
// dropped the challenge params, producing realm/nonce="undefined" in the
|
|
168
|
+
// generated re-auth and a perpetual 401.
|
|
169
|
+
const m = /^\s*digest\s+/i.exec(digest);
|
|
170
|
+
if (!m) return params;
|
|
171
|
+
const challenge = digest.substr(m[0].length);
|
|
169
172
|
const parts = challenge.split(',');
|
|
170
173
|
const length = parts.length;
|
|
171
174
|
for (let i = 0; i < length; i++) {
|