registry-auth-token
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -15,3 +15,3 @@ var path = require('path') | ||
pathname = parsed.pathname || '/' | ||
var regUrl = '//' + parsed.hostname + pathname.replace(/\/$/, '') | ||
var regUrl = '//' + parsed.host + pathname.replace(/\/$/, '') | ||
var urlAlt = regUrl.slice(-1) === '/' ? regUrl : regUrl + '/' | ||
@@ -18,0 +18,0 @@ |
{ | ||
"name": "registry-auth-token", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Get the auth token set for an npm registry (if any)", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
16
test.js
@@ -47,2 +47,18 @@ var fs = require('fs') | ||
it('should return auth token if registry url has port specified', function (done) { | ||
var content = [ | ||
'registry=http://localhost:8770/', | ||
// before the patch this token was selected. | ||
'//localhost/:_authToken=ohno', | ||
'//localhost:8770/:_authToken=beepboop', '' | ||
].join('\n') | ||
fs.writeFile(npmRcPath, content, function (err) { | ||
var getAuthToken = requireUncached('./index') | ||
assert(!err, err) | ||
assert.equal(getAuthToken(), 'beepboop') | ||
done() | ||
}) | ||
}) | ||
it('should try with and without a slash at the end of registry url', function (done) { | ||
@@ -49,0 +65,0 @@ var content = [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7598
7
115