fix proxy limited to kb instead of mb
This commit is contained in:
@@ -243,6 +243,7 @@ var runScriptInVM = function (script_data, user_contextObj = {}, privileged = fa
|
|||||||
"https": https,
|
"https": https,
|
||||||
"sharp": sharp,
|
"sharp": sharp,
|
||||||
"URL": URL,
|
"URL": URL,
|
||||||
|
"URLSearchParams": URLSearchParams,
|
||||||
"wtvshared": wtvshared,
|
"wtvshared": wtvshared,
|
||||||
"zlib": zlib,
|
"zlib": zlib,
|
||||||
"clientShowAlert": clientShowAlert,
|
"clientShowAlert": clientShowAlert,
|
||||||
@@ -1302,7 +1303,7 @@ async function doHTTPProxy(socket, request_headers) {
|
|||||||
res.on('data', d => {
|
res.on('data', d => {
|
||||||
data.push(d);
|
data.push(d);
|
||||||
total_data += d.length;
|
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...`);
|
console.warn(` * Response data exceeded ${minisrv_config.services[request_type].max_response_size || 16}MB limit, destroying...`);
|
||||||
res.destroy();
|
res.destroy();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user