Files
minisrv/zefie_wtvp_minisrv/ServiceVault/wtv-flashrom/initiate-lc2-download.js
zefie fcb94e3058 v0.9.9
- update: config.json: add DoNotEncrypt flags to http and https
 - update: app.js: add ability to override service flags when using getServiceString
 - update: app.js: add ability to disable 'wtv-star' while keeping 'wtv-*'
 - update: app.js: add internal header 'minisrv-use-carriage-return', set to 'false' to disable `\r` in headers
 - implement bf0app flashrom functionality
 - update: actually fix wtv-1800:/preregister and include tellyscripts
2022-11-29 07:43:53 -05:00

17 lines
750 B
JavaScript

if (request_headers.query.path) {
var url = "wtv-flashrom:/get-lc2-page?path=" + request_headers.query.path;
var romtype = ssid_sessions[socket.ssid].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(url.replace("get-lc2-page", "get-by-path"));
if (request_headers.query.numparts) url += escape("&numparts=" + request_headers.query.numparts);
}
headers = "300 OK\n";
headers += "wtv-visit: " + url + "\n";
headers += "Location: " + url + "\n";
headers += "Content-type: text/html";
data = '';
} else {
var errpage = doErrorPage(400)
headers = errpage[0];
data = errpage[1];
}