- numerous bug fixes
 - add UTV tellyscripts
 - BREAKING CHANGE: doErrorPage moved to wtvshared.doErrorPage
	- but I fixed flashrom error handling..
	- added a passthrough for old scripts
 - added eMac's lzpf compression
 - Bump vm2 from 3.9.3 to 3.9.5 in /zefie_wtvp_minisrv
This commit is contained in:
zefie
2021-08-13 17:39:14 -04:00
parent 72c15305fa
commit 245e126298
57 changed files with 740 additions and 509 deletions

View File

@@ -1,10 +1,11 @@
var minisrv_service_file = true;
const WTVFlashrom = require("./WTVFlashrom.js");
var wtvflashrom;
request_is_async = true;
if (!request_headers.query.path) {
var errpage = doErrorPage(400);
var errpage = wtvshared.doErrorPage(400);
headers = errpage[0];
data = errpage[1];
} else {
@@ -21,7 +22,7 @@ async function processLC2DownloadPage(path, flashrom_info, numparts = null) {
if (numparts != null) flashrom_info.part_count = parseInt(numparts);
if (!flashrom_info.part_count) flashrom_info.part_count = parseInt(flashrom_info.message.substring(flashrom_info.message.length - 4).replace(/\D/g, ''));
if (!flashrom_info.part_number || !flashrom_info.is_last_part || !flashrom_info.rompath || !flashrom_info.next_rompath || !flashrom_info.is_bootrom) {
if (!flashrom_info.is_last_part || request_headers.query.last_part) {
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+":/","")));
}
@@ -92,8 +93,7 @@ data += `
<upgradeblock width=280 height=15
nexturl="${flashrom_info.next_rompath}"
errorurl="${service_name}:/lc2-download-failed?"
`
if (!flashrom_info.is_last_part) data += `blockurl = "${flashrom_info.rompath}"`;
blockurl="${flashrom_info.rompath}"`;
data += `
lastblock="${flashrom_info.is_last_part}"
@@ -144,7 +144,7 @@ ${flashrom_info.message}
</body>
</html>`;
} else {
var errpage = doErrorPage(400)
var errpage = wtvshared.doErrorPage(400)
headers = errpage[0];
data = errpage[1];
}