Permalink
Browse files

NPM registry has deprecated http for https

  • Loading branch information...
1 parent 805afa7 commit d9e536ff137e09201a32843fbdc6a36a2413a8a7 @DanielDent DanielDent committed Jul 7, 2016
Showing with 44 additions and 44 deletions.
  1. +1 −1 lib/api.js
  2. +1 −1 lib/package.js
  3. +6 −6 readme.md
  4. +1 −1 test/api.test.js
  5. +1 −1 test/db/foo.json
  6. +4 −4 test/package.test.js
  7. +30 −30 test/resource.test.js
View
@@ -7,7 +7,7 @@ var fs = require('fs'),
Resource = require('./resource.js'),
ETag = require('./etag.js'),
- remoteUrl = 'http://registry.npmjs.com/',
+ remoteUrl = 'https://registry.npmjs.com/',
logger = console;
var api = new Router();
View
@@ -9,7 +9,7 @@ var fs = require('fs'),
// configuration
var externalUrl, // external URL of npm_lazy
- remoteUrl = 'http://registry.npmjs.com/', // "http://registry.npmjs.com/"
+ remoteUrl = 'https://registry.npmjs.com/', // "https://registry.npmjs.com/"
remoteIsHttps = (url.parse(remoteUrl).protocol == 'https:'),
rejectUnauthorized = true,
logger = console;
View
@@ -123,12 +123,12 @@ Next, to simulate a network failure, add `0.0.0.1 registry.npmjs.com` to `/etc/h
npm_lazy at localhost port 8080
npm_lazy cache directory: /home/m/.npm_lazy
- Fetch failed (1/5): http://registry.npmjs.com/socket.io { [Error: connect EINVAL] code: 'EINVAL', errno: 'EINVAL', syscall: 'connect' }
- Fetch failed (2/5): http://registry.npmjs.com/socket.io { [Error: connect EINVAL] code: 'EINVAL', errno: 'EINVAL', syscall: 'connect' }
- Fetch failed (3/5): http://registry.npmjs.com/socket.io { [Error: connect EINVAL] code: 'EINVAL', errno: 'EINVAL', syscall: 'connect' }
- Fetch failed (4/5): http://registry.npmjs.com/socket.io { [Error: connect EINVAL] code: 'EINVAL', errno: 'EINVAL', syscall: 'connect' }
- Fetch failed (5/5): http://registry.npmjs.com/socket.io { [Error: connect EINVAL] code: 'EINVAL', errno: 'EINVAL', syscall: 'connect' }
- [OK] Reusing cached result for http://registry.npmjs.com/socket.io
+ Fetch failed (1/5): https://registry.npmjs.com/socket.io { [Error: connect EINVAL] code: 'EINVAL', errno: 'EINVAL', syscall: 'connect' }
+ Fetch failed (2/5): https://registry.npmjs.com/socket.io { [Error: connect EINVAL] code: 'EINVAL', errno: 'EINVAL', syscall: 'connect' }
+ Fetch failed (3/5): https://registry.npmjs.com/socket.io { [Error: connect EINVAL] code: 'EINVAL', errno: 'EINVAL', syscall: 'connect' }
+ Fetch failed (4/5): https://registry.npmjs.com/socket.io { [Error: connect EINVAL] code: 'EINVAL', errno: 'EINVAL', syscall: 'connect' }
+ Fetch failed (5/5): https://registry.npmjs.com/socket.io { [Error: connect EINVAL] code: 'EINVAL', errno: 'EINVAL', syscall: 'connect' }
+ [OK] Reusing cached result for https://registry.npmjs.com/socket.io
## Configuration
View
@@ -94,7 +94,7 @@ describe('given a server', function() {
rejectUnauthorized: true
});
Package.configure({
- remoteUrl: 'http://registry.npmjs.com/'
+ remoteUrl: 'https://registry.npmjs.com/'
});
});
View
@@ -1 +1 @@
-{"_id":"foo","_rev":"10-9beccbd7a52fd9a186bbf4cc12dd1781","name":"foo","description":"A test module with no `main`, `lib`, or `dependencies` specified","dist-tags":{"latest":"1.0.0"},"users":{},"versions":{"1.0.0":{"author":{"name":"AJ ONeal","email":"coolaj86@gmail.com","url":"http://coolaj86.info"},"name":"foo","description":"A test module with no `main`, `lib`, or `dependencies` specified","version":"1.0.0","repository":{"type":"git","url":"git://github.com/coolaj86/node-pakman.git"},"engines":{"node":">= v0.2"},"_npmUser":{"name":"coolaj86","email":"coolaj86@gmail.com"},"_id":"foo@1.0.0","dependencies":{},"devDependencies":{},"_engineSupported":true,"_npmVersion":"1.0.101","_nodeVersion":"v0.4.8","_defaultsLoaded":true,"dist":{"shasum":"943e0ec03df00ebeb6273a5b94b916ba54b47581","tarball":"http://registry.npmjs.com/foo/-/foo-1.0.0.tgz"},"maintainers":[{"name":"coolaj86","email":"coolaj86@gmail.com"}],"directories":{}}},"maintainers":[{"name":"coolaj86","email":"coolaj86@gmail.com"}],"time":{"modified":"2011-10-21T23:45:45.878Z","created":"2011-10-21T23:45:45.286Z","1.0.0":"2011-10-21T23:45:45.878Z"},"author":{"name":"AJ ONeal","email":"coolaj86@gmail.com","url":"http://coolaj86.info"},"repository":{"type":"git","url":"git://github.com/coolaj86/node-pakman.git"},"_attachments":{}}
+{"_id":"foo","_rev":"10-9beccbd7a52fd9a186bbf4cc12dd1781","name":"foo","description":"A test module with no `main`, `lib`, or `dependencies` specified","dist-tags":{"latest":"1.0.0"},"users":{},"versions":{"1.0.0":{"author":{"name":"AJ ONeal","email":"coolaj86@gmail.com","url":"http://coolaj86.info"},"name":"foo","description":"A test module with no `main`, `lib`, or `dependencies` specified","version":"1.0.0","repository":{"type":"git","url":"git://github.com/coolaj86/node-pakman.git"},"engines":{"node":">= v0.2"},"_npmUser":{"name":"coolaj86","email":"coolaj86@gmail.com"},"_id":"foo@1.0.0","dependencies":{},"devDependencies":{},"_engineSupported":true,"_npmVersion":"1.0.101","_nodeVersion":"v0.4.8","_defaultsLoaded":true,"dist":{"shasum":"943e0ec03df00ebeb6273a5b94b916ba54b47581","tarball":"https://registry.npmjs.com/foo/-/foo-1.0.0.tgz"},"maintainers":[{"name":"coolaj86","email":"coolaj86@gmail.com"}],"directories":{}}},"maintainers":[{"name":"coolaj86","email":"coolaj86@gmail.com"}],"time":{"modified":"2011-10-21T23:45:45.878Z","created":"2011-10-21T23:45:45.286Z","1.0.0":"2011-10-21T23:45:45.878Z"},"author":{"name":"AJ ONeal","email":"coolaj86@gmail.com","url":"http://coolaj86.info"},"repository":{"type":"git","url":"git://github.com/coolaj86/node-pakman.git"},"_attachments":{}}
@@ -33,7 +33,7 @@ describe('given a package', function() {
Package.getIndex('foo', auth, function(err, actual) {
var expected = JSON.parse(
fs.readFileSync(__dirname + '/db/foo.json')
- .toString().replace('http://registry.npmjs.com/foo', 'http://localhost:8080/foo')
+ .toString().replace('https://registry.npmjs.com/foo', 'http://localhost:8080/foo')
);
assert.deepEqual(actual, expected);
done();
@@ -44,7 +44,7 @@ describe('given a package', function() {
Package.getVersion('foo', '1.0.0', function(err, json) {
var expected = JSON.parse(
fs.readFileSync(__dirname + '/db/foo.json')
- .toString().replace('http://registry.npmjs.com/foo', 'http://localhost:8080/foo')
+ .toString().replace('https://registry.npmjs.com/foo', 'http://localhost:8080/foo')
).versions['1.0.0'];
assert.deepEqual(json, expected);
done();
@@ -56,7 +56,7 @@ describe('given a package', function() {
if (fs.existsSync(out)) {
fs.unlinkSync(out);
}
- Resource.get('http://registry.npmjs.com/foo/-/foo-1.0.0.tgz')
+ Resource.get('https://registry.npmjs.com/foo/-/foo-1.0.0.tgz')
.getReadablePath(function(err, fullpath) {
fs.createReadStream(fullpath).pipe(
fs.createWriteStream(out)
@@ -72,7 +72,7 @@ describe('given a package', function() {
it('can check file sha', function(done) {
var requireincontextDir = fixture.dir({
- 'index.json': '{"_id":"requireincontext","_rev":"5-988ff7c27a21e527ceeb50cbedc8d1b0","name":"requireincontext","description":"Wrapper to require() js files in a custom context","dist-tags":{"latest":"0.0.2"},"versions":{"0.0.1":{"name":"requireincontext","description":"Wrapper to require() js files in a custom context","version":"0.0.1","author":{"name":"Mikito Takada","email":"mixu@mixu.net"},"keywords":["require"],"repository":{"type":"git","url":"git://github.com/mixu/requireincontext.git"},"main":"index.js","_npmJsonOpts":{"file":"/home/mtakada/.npm/requireincontext/0.0.1/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"requireincontext@0.0.1","dependencies":{},"devDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.22","_nodeVersion":"v0.4.11-pre","_defaultsLoaded":true,"dist":{"shasum":"a47054a6e05bc7d6d7b7965fd0631ee58f4e72ef","tarball":"http://registry.npmjs.com/requireincontext/-/requireincontext-0.0.1.tgz"},"scripts":{},"maintainers":[{"name":"mixu","email":"mixu@mixu.net"}],"directories":{}},"0.0.2":{"name":"requireincontext","description":"Wrapper to require() js files in a custom context","version":"0.0.2","author":{"name":"Mikito Takada","email":"mixu@mixu.net"},"keywords":["require"],"repository":{"type":"git","url":"git://github.com/mixu/requireincontext.git"},"main":"index.js","_npmJsonOpts":{"file":"/home/mtakada/.npm/requireincontext/0.0.2/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"requireincontext@0.0.2","dependencies":{},"devDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.22","_nodeVersion":"v0.4.11-pre","_defaultsLoaded":true,"dist":{"shasum":"4a77c6f7ccbd43e095d9fc6c943e53707e042f41","tarball":"http://registry.npmjs.com/requireincontext/-/requireincontext-0.0.2.tgz"},"scripts":{},"maintainers":[{"name":"mixu","email":"mixu@mixu.net"}],"directories":{}}},"maintainers":[{"name":"mixu","email":"mixu@mixu.net"}],"time":{"0.0.1":"2011-08-17T21:20:46.028Z","0.0.2":"2011-08-17T21:52:41.196Z"},"author":{"name":"Mikito Takada","email":"mixu@mixu.net"},"repository":{"type":"git","url":"git://github.com/mixu/requireincontext.git"}}',
+ 'index.json': '{"_id":"requireincontext","_rev":"5-988ff7c27a21e527ceeb50cbedc8d1b0","name":"requireincontext","description":"Wrapper to require() js files in a custom context","dist-tags":{"latest":"0.0.2"},"versions":{"0.0.1":{"name":"requireincontext","description":"Wrapper to require() js files in a custom context","version":"0.0.1","author":{"name":"Mikito Takada","email":"mixu@mixu.net"},"keywords":["require"],"repository":{"type":"git","url":"git://github.com/mixu/requireincontext.git"},"main":"index.js","_npmJsonOpts":{"file":"/home/mtakada/.npm/requireincontext/0.0.1/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"requireincontext@0.0.1","dependencies":{},"devDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.22","_nodeVersion":"v0.4.11-pre","_defaultsLoaded":true,"dist":{"shasum":"a47054a6e05bc7d6d7b7965fd0631ee58f4e72ef","tarball":"https://registry.npmjs.com/requireincontext/-/requireincontext-0.0.1.tgz"},"scripts":{},"maintainers":[{"name":"mixu","email":"mixu@mixu.net"}],"directories":{}},"0.0.2":{"name":"requireincontext","description":"Wrapper to require() js files in a custom context","version":"0.0.2","author":{"name":"Mikito Takada","email":"mixu@mixu.net"},"keywords":["require"],"repository":{"type":"git","url":"git://github.com/mixu/requireincontext.git"},"main":"index.js","_npmJsonOpts":{"file":"/home/mtakada/.npm/requireincontext/0.0.2/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"requireincontext@0.0.2","dependencies":{},"devDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.22","_nodeVersion":"v0.4.11-pre","_defaultsLoaded":true,"dist":{"shasum":"4a77c6f7ccbd43e095d9fc6c943e53707e042f41","tarball":"https://registry.npmjs.com/requireincontext/-/requireincontext-0.0.2.tgz"},"scripts":{},"maintainers":[{"name":"mixu","email":"mixu@mixu.net"}],"directories":{}}},"maintainers":[{"name":"mixu","email":"mixu@mixu.net"}],"time":{"0.0.1":"2011-08-17T21:20:46.028Z","0.0.2":"2011-08-17T21:52:41.196Z"},"author":{"name":"Mikito Takada","email":"mixu@mixu.net"},"repository":{"type":"git","url":"git://github.com/mixu/requireincontext.git"}}',
'requireincontext-0.0.2.tgz': '{"error":"not_found","reason":"document not found"}\n'
});
Oops, something went wrong.

0 comments on commit d9e536f

Please sign in to comment.