Socket
Socket
Sign inDemoInstall

registry-auth-token

Package Overview
Dependencies
5
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.1.0 to 1.1.1

CHANGELOG.md

2

index.js

@@ -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",

@@ -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 = [

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc