fix: add error handling for URL parsing in Proxifier class

This commit is contained in:
Viren070
2025-09-29 20:25:27 +01:00
parent 60fd28cd72
commit 6e0e6f587b
+12 -2
View File
@@ -20,8 +20,18 @@ class Proxifier {
if (stream.proxied) {
return false;
}
const streamUrl = new URL(stream.url);
const proxyUrl = new URL(proxy.url);
let streamUrl: URL;
let proxyUrl: URL;
try {
streamUrl = new URL(stream.url);
proxyUrl = new URL(proxy.url);
} catch (error) {
logger.error(
`URL parsing failed somehow: stream: ${JSON.stringify(stream)}, proxy: ${JSON.stringify(proxy)}`
);
logger.error(error);
return false;
}
if (
streamUrl.host === proxyUrl.host &&
// check for proxy endpoint for stremthru, not needed for mediaflow as all mediaflow links are proxied