Use TextDecoder and TextEncoder instead of unescape.

This commit is contained in:
Nat Puch 2021-12-22 18:11:45 +01:00
parent 18c9282cd1
commit c555d14f15

View File

@ -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) {