From 6e94d1158340f9137f831db21e3f4a4ce67c7ce7 Mon Sep 17 00:00:00 2001 From: "Michael J. Ryan" Date: Thu, 25 Jan 2018 11:43:32 -0600 Subject: [PATCH 1/4] add fetchAPI support support for fetchAPI (node-fetch) in addition to request interface. --- lib/ntlm.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ntlm.js b/lib/ntlm.js index 4d2863b..da005e8 100755 --- a/lib/ntlm.js +++ b/lib/ntlm.js @@ -226,7 +226,8 @@ exports.challengeHeader = function (hostname, domain) { }; exports.responseHeader = function (res, url, domain, username, password) { - var serverNonce = new Buffer((res.headers['www-authenticate'].match(/^NTLM\s+(.+?)(,|\s+|$)/) || [])[1], 'base64'); + var authHeader = (typeof res.headers.get === 'function') ? res.headers.get('www-authenticate') : res.headers['www-authenticate']; + var serverNonce = new Buffer((authHeader.match(/^NTLM\s+(.+?)(,|\s+|$)/) || [])[1], 'base64'); var hostname = require('url').parse(url).hostname; return 'NTLM ' + exports.encodeType3(username, hostname, domain, exports.decodeType2(serverNonce), password).toString('base64') }; From 76bdbb27cbf4fc2153e41731239d0a1ea5a84d04 Mon Sep 17 00:00:00 2001 From: "Michael J. Ryan" Date: Thu, 25 Jan 2018 11:47:00 -0600 Subject: [PATCH 2/4] bump version for publish bump version for publish --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index af547dd..e2e5939 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ntlm", - "version": "0.1.3", + "version": "0.1.4", "devDependencies": { "nodeunit": "*" }, From 51c22b89283a57e83ebf9d107bfa115dbe7234f7 Mon Sep 17 00:00:00 2001 From: "Michael J. Ryan" Date: Thu, 25 Jan 2018 11:55:07 -0600 Subject: [PATCH 3/4] add test npm script --- package.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index e2e5939..028eb42 100644 --- a/package.json +++ b/package.json @@ -18,5 +18,8 @@ ], "main": "lib/ntlm.js", "description": "NTLM authentication and Samba LM/NT hash library", - "homepage": "https://github.com/tcr/node-ntlm" + "homepage": "https://github.com/tcr/node-ntlm", + "scripts": { + "test": "node ./run_tests.js" + } } From be658b4df1e531fc177b9816de2b4043c5cfc356 Mon Sep 17 00:00:00 2001 From: "Michael J. Ryan" Date: Thu, 25 Jan 2018 11:57:16 -0600 Subject: [PATCH 4/4] create config for travis-ci --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..efb0983 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,3 @@ +language: node_js +node_js: + - "8"