aboutsummaryrefslogtreecommitdiff
path: root/lib/serve.js
diff options
context:
space:
mode:
authorcel <cel@lOUVT+Phkvai9a/cCS/RKo+S9hnPAQdVixms/7ldpPA=.ed25519>2020-05-19 09:20:21 -0400
committercel <cel@lOUVT+Phkvai9a/cCS/RKo+S9hnPAQdVixms/7ldpPA=.ed25519>2020-05-19 09:20:21 -0400
commite537f08964e2fcfe94f3777ef75c82f928b65121 (patch)
treeb658a625e5fe474212e5ddc4de2b46a00b9112f2 /lib/serve.js
parentde1eaa7c9d937a82f5330e3bf3955444411fd193 (diff)
downloadpatchfoo-e537f08964e2fcfe94f3777ef75c82f928b65121.tar.gz
patchfoo-e537f08964e2fcfe94f3777ef75c82f928b65121.zip
Avoide deprecated Buffer constructor
Diffstat (limited to 'lib/serve.js')
-rw-r--r--lib/serve.js10
1 files changed, 5 insertions, 5 deletions
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)
)