Skip to content

Commit

Permalink
fix return Error if invite challenge without authenticate header
Browse files Browse the repository at this point in the history
  • Loading branch information
xquanluu committed Feb 20, 2025
1 parent 3b61b05 commit 82d0ef0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/digest-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ module.exports = class DigestClient {
}

const header = this.res.statusCode === 407 ? 'proxy-authenticate' : 'www-authenticate' ;
if (!this.res.has(header)) {
return callback(new Error(`missing ${header} in ${this.res.statusCode} response`));
}
const challenge = this._parseChallenge(this.res.get(header));

const ha1 = crypto.createHash('md5');
Expand Down

0 comments on commit 82d0ef0

Please sign in to comment.