prefer wtvshared.escape over encodeURIComponent

This commit is contained in:
zefie
2025-08-14 18:57:37 -04:00
parent 54b960a840
commit e7d16387da
27 changed files with 223 additions and 205 deletions

View File

@@ -54,12 +54,12 @@ lib.get(targetUrl, (res) => {
if (urlInputMatch) {
pageUrl = urlInputMatch[1];
}
const redirectUrl = `${service_name}:/proxy?id=${proxy_id}&t=${imgExt}&url=${encodeURIComponent(pageUrl)}`;
const redirectUrl = `${service_name}:/proxy?id=${proxy_id}&t=${imgExt}&url=${wtvshared.escape(pageUrl)}`;
sendToClient(socket, {'Status': 302, 'Location': redirectUrl}, '');
} else {
const idx = data.indexOf('<BR>');
data = data.slice(0, idx);
const redirectUrl = `${service_name}:/proxy?err=${encodeURIComponent(data)}`;
const redirectUrl = `${service_name}:/proxy?err=${wtvshared.escape(data)}`;
sendToClient(socket, {'Status': 302, 'Location': redirectUrl}, '');
}
});