- added example docker-compose for minisrv + webone - update: wtv-home:/home: reduce size of title to fit longer version numbers - update: wtv-chat:/home: fix colors - update: login system: do not send tellyscript nor login headers to reconnecting (eg client:redial) client - fix: fixed tellyscript path for wtv-1800:/noflash (bf0app braindead) - update flashrom subsystem: - moved duplicate code into WTVFlashrom class - smarter part information detection - http(s) proxy updates: - allow ~ character - fix HTTPS when using HTTP proxy - include example webone.conf for external HTTP Proxy - update: app.js: enable graceful shutdown with SIGTERM - update: add service ip to wtv-tricks:/info
34 lines
1.3 KiB
JavaScript
34 lines
1.3 KiB
JavaScript
const WTVFlashrom = require("./WTVFlashrom.js");
|
|
request_is_async = true;
|
|
|
|
var bf0app_update = false;
|
|
var request_path = unescape(request_headers.query.path);
|
|
|
|
if (ssid_sessions[socket.ssid].get("wtv-client-rom-type") == "bf0app" && ssid_sessions[socket.ssid].get("wtv-client-bootrom-version") == "105") {
|
|
// assume old classic in flash mode, override user setting and send tellyscript
|
|
// because it is required to proceed in flash mode
|
|
bf0app_update = true;
|
|
ssid_sessions[socket.ssid].set("bf0app_update", bf0app_update);
|
|
}
|
|
|
|
if (request_headers.query.raw || bf0app_update) {
|
|
if (!ssid_sessions[socket.ssid].data_store.WTVFlashrom) {
|
|
ssid_sessions[socket.ssid].data_store.WTVFlashrom = new WTVFlashrom(service_vaults, service_name, minisrv_config.services[service_name].use_zefie_server, bf0app_update);
|
|
}
|
|
|
|
ssid_sessions[socket.ssid].data_store.WTVFlashrom.getFlashRom(request_path, function (data, headers) {
|
|
sendToClient(socket, headers, data);
|
|
});
|
|
} else {
|
|
headers = "200 OK\n"
|
|
if (request_headers.query.path) {
|
|
headers += "Content-type: text/html\n"
|
|
headers += "wtv-visit: wtv-flashrom:/initiate-lc2-download?path=" + request_headers.query.path;
|
|
data = '';
|
|
} else {
|
|
var errpage = doErrorPage(404)
|
|
headers = errpage[0];
|
|
data = errpage[1];
|
|
}
|
|
sendToClient(socket, headers, data);
|
|
} |