hono 0.3.1 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -25,8 +25,15 @@ const auth = (req) => {
|
|
|
25
25
|
return { username: userPass[1], password: userPass[2] };
|
|
26
26
|
};
|
|
27
27
|
function decodeBase64(str) {
|
|
28
|
-
if (atob
|
|
29
|
-
|
|
28
|
+
if (atob) {
|
|
29
|
+
const text = atob(str);
|
|
30
|
+
const length = text.length;
|
|
31
|
+
const bytes = new Uint8Array(length);
|
|
32
|
+
for (let i = 0; i < length; i++) {
|
|
33
|
+
bytes[i] = text.charCodeAt(i);
|
|
34
|
+
}
|
|
35
|
+
const decoder = new TextDecoder();
|
|
36
|
+
return decoder.decode(bytes);
|
|
30
37
|
}
|
|
31
38
|
else {
|
|
32
39
|
const { Buffer } = require('buffer');
|