From c555d14f159fd1eb2adb5d413d3dca11cd4b18f8 Mon Sep 17 00:00:00 2001 From: Nat Puch Date: Wed, 22 Dec 2021 18:11:45 +0100 Subject: [PATCH] Use TextDecoder and TextEncoder instead of unescape. --- frontend/src/api/pub.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/src/api/pub.js b/frontend/src/api/pub.js index bf42438c..2a65902a 100644 --- a/frontend/src/api/pub.js +++ b/frontend/src/api/pub.js @@ -3,9 +3,11 @@ import { baseURL } from "@/utils/constants"; export async function fetch(url, password = "") { url = removePrefix(url); + let deiso = new TextDecoder("iso88591"); + let enutf8 = new TextEncoder(); const res = await fetchURL(`/api/public/share${url}`, { - headers: { "X-SHARE-PASSWORD": unescape(encodeURIComponent(password)) }, + headers: { "X-SHARE-PASSWORD": deiso.decode(enutf8.encode(password)) }, }); if (res.status === 200) {