From 6c8bc496f973067caf9c7a8fe3470fef0bc8e8fc Mon Sep 17 00:00:00 2001 From: Sven SAULEAU Date: Sat, 26 May 2018 10:23:42 +0200 Subject: [PATCH] fix: use HTTPS registry --- config.js | 2 +- server/utils/get.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config.js b/config.js index cbe915e..3dfe020 100644 --- a/config.js +++ b/config.js @@ -3,7 +3,7 @@ const sander = require( 'sander' ); exports.root = path.resolve( __dirname ); exports.tmpdir = process.env.NOW ? `/tmp` : `${exports.root}/.tmp`; -exports.registry = `http://registry.npmjs.org`; +exports.registry = 'https://registry.npmjs.org'; if ( !process.env.NOW ) { try { diff --git a/server/utils/get.js b/server/utils/get.js index d3d5e97..d4d64c8 100644 --- a/server/utils/get.js +++ b/server/utils/get.js @@ -1,8 +1,8 @@ -const http = require( 'http' ); +const https = require( 'https' ); module.exports = function get ( url ) { return new Promise( ( fulfil, reject ) => { - http.get( url, response => { + https.get( url, response => { let body = ''; response.on( 'data', chunk => { @@ -16,4 +16,4 @@ module.exports = function get ( url ) { response.on( 'error', reject ); }); }); -}; \ No newline at end of file +};