more optimizations
This commit is contained in:
@@ -43,8 +43,8 @@ async function processLC2DownloadPage(flashrom_info, headers, numparts = null) {
|
||||
|
||||
if (!flashrom_info.is_last_part) {
|
||||
flashrom_info.next_rompath = request_headers.request_url.replace(
|
||||
escape(request_headers.query.path),
|
||||
escape(flashrom_info.next_rompath.replace(service_name + ":/", ""))
|
||||
encodeURIComponent(request_headers.query.path),
|
||||
encodeURIComponent(flashrom_info.next_rompath.replace(service_name + ":/", ""))
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -4,8 +4,8 @@ if (request_headers.query.path) {
|
||||
var url = service_name + ":/get-lc2-page?path=" + request_headers.query.path;
|
||||
var romtype = session_data.get("wtv-client-rom-type");
|
||||
if (romtype == "bf0app") {
|
||||
url = "client:updateflash?ipaddr=" + minisrv_config.services[service_name].host + "&port=" + minisrv_config.services[service_name].port + "&path=" + escape(service_name + ":/" + request_headers.query.path);
|
||||
if (request_headers.query.numparts) url += escape("?numparts=" + request_headers.query.numparts);
|
||||
url = "client:updateflash?ipaddr=" + minisrv_config.services[service_name].host + "&port=" + minisrv_config.services[service_name].port + "&path=" + encodeURIComponent(service_name + ":/" + request_headers.query.path);
|
||||
if (request_headers.query.numparts) url += encodeURIComponent("?numparts=" + request_headers.query.numparts);
|
||||
} else {
|
||||
if (request_headers.query.numparts) url += "&numparts=" + request_headers.query.numparts;
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ if (request_headers.query.vflash) delete request_headers.query.vflash;
|
||||
if (request_headers.query.pflash) delete request_headers.query.pflash;
|
||||
|
||||
for (const [key, value] of Object.entries(request_headers.query)) {
|
||||
proxy_query += "&" + key + "=" + escape(value);
|
||||
proxy_query += "&" + key + "=" + encodeURIComponent(value);
|
||||
}
|
||||
|
||||
if (!minisrv_config.services[service_name].use_zefie_server) {
|
||||
@@ -20,7 +20,7 @@ if (!minisrv_config.services[service_name].use_zefie_server) {
|
||||
|
||||
var options = {
|
||||
host: "roms.minisrv.dev",
|
||||
path: "/?minisrv=true&service_name="+escape(service_name)+"&pflash=" + session_data.get("wtv-client-rom-type") + proxy_query,
|
||||
path: "/?minisrv=true&service_name="+encodeURIComponent(service_name)+"&pflash=" + session_data.get("wtv-client-rom-type") + proxy_query,
|
||||
timeout: 5000,
|
||||
method: 'GET'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user