summaryrefslogtreecommitdiff
path: root/std/node
diff options
context:
space:
mode:
authortimonson <54777088+timonson@users.noreply.github.com>2020-10-13 03:12:10 +0200
committerGitHub <noreply@github.com>2020-10-13 12:12:10 +1100
commit1956cb81372b96bc476e74ab43a62a6e60861277 (patch)
tree014dd7c132239eab61cceb0d31b6d27304a8ead5 /std/node
parent26639b3bac463768c65f7fc40a1c53317549e1eb (diff)
fix(std/encoding): base64 properly encodes mbc and handles Uint8Arrays (#7807)
Fixes #6094 Fixes #4794
Diffstat (limited to 'std/node')
-rw-r--r--std/node/buffer.ts2
1 files changed, 1 insertions, 1 deletions
diff --git a/std/node/buffer.ts b/std/node/buffer.ts
index 2a9f0bb56..01a574067 100644
--- a/std/node/buffer.ts
+++ b/std/node/buffer.ts
@@ -213,7 +213,7 @@ export default class Buffer extends Uint8Array {
if (typeof value == "string") {
encoding = checkEncoding(encoding, false);
if (encoding === "hex") return new Buffer(hex.decodeString(value).buffer);
- if (encoding === "base64") return new Buffer(base64.decode(value));
+ if (encoding === "base64") return new Buffer(base64.decode(value).buffer);
return new Buffer(new TextEncoder().encode(value).buffer);
}