Skip to content

Commit

Permalink
Save staled authentication replay flag for later verification
Browse files Browse the repository at this point in the history
  • Loading branch information
jmillan committed Nov 24, 2012
1 parent e8dbaea commit 96b9f6c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/RequestSender.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,18 @@ JsSIP.RequestSender.prototype = {
challenge = response.s('Proxy-Authenticate');
}

if ( !this.challenged || (this.challenged && !this.staled && challenge.stale) ) {
if ( !this.challenged || (this.challenged && !this.staled && challenge.stale === 'true') ) {
if (!this.credentials) {
this.credentials = new JsSIP.DigestAuthentication(this.ua, this.request, response);
} else {
this.credentials.update(response);
}

if (challenge.stale === 'true') {
this.staled = true;
}


if (response.method === JsSIP.c.REGISTER) {
cseq = this.applicant.cseq += 1;
} else if (this.request.dialog){
Expand Down

0 comments on commit 96b9f6c

Please sign in to comment.