Files
minisrv/zefie_wtvp_minisrv/ServiceVault/wtv-flashrom/initiate-lc2-download.js
zefie 6e9e84abf0 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
2021-08-02 14:47:11 -04: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];
}