From 1dd07715db707947a158577765e0aa86433d7915 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Tue, 19 Jun 2018 01:28:03 -0600 Subject: [PATCH] request => @coolaj86/urequest --- node.js | 14 +++++++------- package.json | 5 +---- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/node.js b/node.js index 50927e5..4ea2b78 100644 --- a/node.js +++ b/node.js @@ -140,7 +140,7 @@ ACME._registerAccount = function (me, options) { , kid: options.externalAccount.id , url: me._directoryUrls.newAccount } - , new Buffer(JSON.stringify(jwk)) + , Buffer.from(JSON.stringify(jwk)) ); } var payload = JSON.stringify(body); @@ -152,7 +152,7 @@ ACME._registerAccount = function (me, options) { , url: me._directoryUrls.newAccount , jwk: jwk } - , new Buffer(payload) + , Buffer.from(payload) ); delete jws.header; @@ -288,7 +288,7 @@ ACME._postChallenge = function (me, options, identifier, ch) { options.accountKeypair , undefined , { nonce: me._nonce, alg: 'RS256', url: ch.url, kid: me._kid } - , new Buffer(JSON.stringify({ "status": "deactivated" })) + , Buffer.from(JSON.stringify({ "status": "deactivated" })) ); me._nonce = null; return me._request({ @@ -367,7 +367,7 @@ ACME._postChallenge = function (me, options, identifier, ch) { options.accountKeypair , undefined , { nonce: me._nonce, alg: 'RS256', url: ch.url, kid: me._kid } - , new Buffer(JSON.stringify({ })) + , Buffer.from(JSON.stringify({ })) ); me._nonce = null; return me._request({ @@ -439,7 +439,7 @@ ACME._finalizeOrder = function (me, options, validatedDomains) { options.accountKeypair , undefined , { nonce: me._nonce, alg: 'RS256', url: me._finalize, kid: me._kid } - , new Buffer(payload) + , Buffer.from(payload) ); if (me.debug) console.debug('finalize:', me._finalize); @@ -544,7 +544,7 @@ ACME._getCertificate = function (me, options) { options.accountKeypair , undefined , { nonce: me._nonce, alg: 'RS256', url: me._directoryUrls.newOrder, kid: me._kid } - , new Buffer(payload) + , Buffer.from(payload) ); if (me.debug) console.debug('\n[DEBUG] newOrder\n'); @@ -627,7 +627,7 @@ ACME.create = function create(me) { // me.debug = true; me.challengePrefixes = ACME.challengePrefixes; me.RSA = me.RSA || require('rsa-compat').RSA; - me.request = me.request || require('request'); + me.request = me.request || require('@coolaj86/urequest'); me._dig = function (query) { // TODO use digd.js return new Promise(function (resolve, reject) { diff --git a/package.json b/package.json index 3b7a7ec..6225182 100644 --- a/package.json +++ b/package.json @@ -39,10 +39,7 @@ "author": "AJ ONeal (https://coolaj86.com/)", "license": "(MIT OR Apache-2.0)", "dependencies": { - "request": "^2.85.0", + "@coolaj86/urequest": "^1.1.1", "rsa-compat": "^1.3.0" - }, - "optionalDependencies": { - "bluebird": "^3.5.1" } }