From e537f08964e2fcfe94f3777ef75c82f928b65121 Mon Sep 17 00:00:00 2001 From: cel Date: Tue, 19 May 2020 09:20:21 -0400 Subject: Avoide deprecated Buffer constructor --- lib/serve.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lib/serve.js') diff --git a/lib/serve.js b/lib/serve.js index 749e075..d292158 100644 --- a/lib/serve.js +++ b/lib/serve.js @@ -2090,7 +2090,7 @@ Serve.prototype.blob = function (id, path) { } if (unbox) { try { - key = new Buffer(unbox, 'base64') + key = Buffer.from(unbox, 'base64') } catch(err) { return self.respond(400, err.message) } @@ -2147,14 +2147,14 @@ Serve.prototype.blob = function (id, path) { self.res.writeHead(206) wroteHeaders = true }), - pull.map(Buffer), + pull.map(Buffer.from), self.respondSink() ) } else { pull( self.app.getBlob(id, key), - pull.map(Buffer), + pull.map(Buffer.from), ident(gotType), self.respondSink() ) @@ -2197,7 +2197,7 @@ Serve.prototype.image = function (path) { } if (unbox) { try { - key = new Buffer(unbox, 'base64') + key = Buffer.from(unbox, 'base64') } catch(err) { return self.respond(400, err.message) } @@ -2217,7 +2217,7 @@ Serve.prototype.image = function (path) { pull( self.app.getBlob(id, key), - pull.map(Buffer), + pull.map(Buffer.from), ident(heresTheType), pull.collect(onFullBuffer) ) -- cgit v1.2.3