Skip to content

Commit a6bcd85

Browse files
stevebioanu3990
authored andcommitted
MLE-123456 - polaris fixes: remove unreachable break and continue statements, unused variables, and move return note_error line outside of the for loop, which was probably intended.
1 parent c302cf6 commit a6bcd85

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

lib/www-authenticate-patched/parsers.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,10 @@ var ParseAuth= /(\w+)\s+(.*)/ // -> scheme, params
1515

1616
function parse_params(header) {
1717
// This parser will definitely fail if there is more than one challenge
18-
var tok, last_tok, _i, _len, key, value;
18+
var tok, _i, _len, key, value;
1919
var state= 0; //0: token,
2020
var m= header.split(Separators)
2121
for (_i = 0, _len = m.length; _i < _len; _i++) {
22-
last_tok= tok;
2322
tok = m[_i];
2423
if (!tok.length) continue;
2524
switch (state) {
@@ -67,7 +66,6 @@ function parse_params(header) {
6766
else {
6867
return 'Unexpected token ('+tok+') after '+value+'"';
6968
}
70-
continue;
7169
case 9: // expect commma
7270
if (',' != tok) return 'Comma expected after '+value;
7371
state= 0;

lib/www-authenticate-patched/www-authenticate.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ var www_authenticator = function(username,password,options)
9191
}
9292
else {
9393
var qopa= qop.split(',');
94-
var q, x, _i, _len;
94+
var _i, _len;
9595
for (_i = 0, _len = qopa.length; _i < _len; _i++) {
9696
if ('auth' === qopa[_i]) {
9797
var opaque= auth_parms.opaque;
@@ -123,10 +123,9 @@ var www_authenticator = function(username,password,options)
123123
};
124124
return;
125125
}
126-
return note_error('Server does not accept any supported quality of protection techniques.');
127126
}
127+
return note_error('Server does not accept any supported quality of protection techniques.');
128128
}
129-
break;
130129
default:
131130
return note_error("Unknown scheme");
132131
}

0 commit comments

Comments
 (0)