fix proxy limited to kb instead of mb

This commit is contained in:
zefie
2025-07-22 14:52:45 -04:00
parent 2b2735264a
commit 60f6709171

View File

@@ -243,6 +243,7 @@ var runScriptInVM = function (script_data, user_contextObj = {}, privileged = fa
"https": https,
"sharp": sharp,
"URL": URL,
"URLSearchParams": URLSearchParams,
"wtvshared": wtvshared,
"zlib": zlib,
"clientShowAlert": clientShowAlert,
@@ -1302,7 +1303,7 @@ async function doHTTPProxy(socket, request_headers) {
res.on('data', d => {
data.push(d);
total_data += d.length;
if (total_data > 1024 * parseFloat(minisrv_config.services[request_type].max_response_size || 16)) {
if (total_data > 1024 * 1024 * parseFloat(minisrv_config.services[request_type].max_response_size || 16)) {
console.warn(` * Response data exceeded ${minisrv_config.services[request_type].max_response_size || 16}MB limit, destroying...`);
res.destroy();
}