From: Jesse Tane <jesse.tane@gmail.com>
Date: Wed, 31 Dec 2014 05:02:15 +0000 (-0500)
Subject: Revert "allow decoding url-safe base64 space and slash"
X-Git-Url: https://zoso.dev/?a=commitdiff_plain;h=004948e82bb3fa0211141074759d1433d591e5e8;p=buffer.git

Revert "allow decoding url-safe base64 space and slash"

This reverts commit 767070ece98af730d110e4905aa454db6a4a9a4c.
---

diff --git a/index.js b/index.js
index a9a9b5d..1aa5acc 100644
--- a/index.js
+++ b/index.js
@@ -1146,8 +1146,6 @@ var INVALID_BASE64_RE = /[^+\/0-9A-z\-]/g
 function base64clean (str) {
   // Node strips out invalid characters like \n and \t from the string, base64-js does not
   str = stringtrim(str).replace(INVALID_BASE64_RE, '')
-  // replace url-safe space and slash
-  str = str.replace(/-/g, '+').replace(/_/g, '/')
   // Node converts strings with length < 2 to ''
   if (str.length < 2) return ''
   // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not