Skip to content

Commit 42b5c64

Browse files
committed
Modified Regex
If there was no comma or whitespace at the end of www-authenticate, this would fail to match. Added EOL to the list.
1 parent 77fa20d commit 42b5c64

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/ntlm.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ exports.challengeHeader = function (hostname, domain) {
227227
};
228228

229229
exports.responseHeader = function (res, url, domain, username, password) {
230-
var serverNonce = new Buffer((res.headers['www-authenticate'].match(/^NTLM\s+(.+?)(,|\s+)/) || [])[1], 'base64');
230+
var serverNonce = new Buffer((res.headers['www-authenticate'].match(/^NTLM\s+(.+?)(,|\s+|$)/) || [])[1], 'base64');
231231
var hostname = require('url').parse(url).hostname;
232232
return 'NTLM ' + exports.encodeType3(username, hostname, domain, exports.decodeType2(serverNonce), password).toString('base64')
233233
};

0 commit comments

Comments
 (0)