v0.9.8
fix: app.js: Use \r\n, fix connections= service setting update: config.json: fix some service flags that were misset Add ServiceFlags.txt: brief description of wtv-service flags update: Moved tellyscripts to wtv-1800:/preregister update: fixed bug where "send_tellyscript was undefined" update: initial work on bf0app flashrom support (incomplete)
This commit is contained in:
@@ -494,9 +494,9 @@ async function sendToClient(socket, headers_obj, data) {
|
||||
} else {
|
||||
if (k.indexOf('_') >= 0) {
|
||||
var j = k.split('_')[0];
|
||||
headers += j + ": " + headers_obj[k] + "\n";
|
||||
headers += j + ": " + headers_obj[k] + "\r\n";
|
||||
} else {
|
||||
headers += k + ": " + headers_obj[k] + "\n";
|
||||
headers += k + ": " + headers_obj[k] + "\r\n";
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -505,17 +505,17 @@ async function sendToClient(socket, headers_obj, data) {
|
||||
// send to client
|
||||
var toClient = null;
|
||||
if (typeof data == 'string') {
|
||||
toClient = headers + "\n" + data;
|
||||
toClient = headers + "\r\n" + data;
|
||||
socket.write(toClient);
|
||||
} else if (typeof data == 'object') {
|
||||
if (zquiet) var verbosity_mod = (headers_obj["wtv-encrypted"] == 'true') ? " encrypted response" : "";
|
||||
if (socket_sessions[socket.id].secure_headers == true) {
|
||||
// encrypt headers
|
||||
if (zquiet)verbosity_mod += " with encrypted headers";
|
||||
var enc_headers = socket_sessions[socket.id].wtvsec.Encrypt(1, headers + "\n");
|
||||
var enc_headers = socket_sessions[socket.id].wtvsec.Encrypt(1, headers + "\r\n");
|
||||
socket.write(new Uint8Array(concatArrayBuffer(enc_headers, data)));
|
||||
} else {
|
||||
socket.write(new Uint8Array(concatArrayBuffer(Buffer.from(headers + "\n"), data)));
|
||||
socket.write(new Uint8Array(concatArrayBuffer(Buffer.from(headers + "\r\n"), data)));
|
||||
}
|
||||
if (zquiet) console.log(" * Sent" + verbosity_mod + " " + headers_obj.http_response + " to client (Content-Type:", headers_obj['Content-Type'], "~", headers_obj['Content-Length'], "bytes)");
|
||||
}
|
||||
@@ -1221,11 +1221,11 @@ Object.keys(minisrv_config.services).forEach(function (k) {
|
||||
minisrv_config.services[k].toString = function () {
|
||||
var outstr = "wtv-service: name=" + this.name + " host=" + this.host + " port=" + this.port;
|
||||
if (this.flags) outstr += " flags=" + this.flags;
|
||||
if (this.connections) outstr += " flags=" + this.connections;
|
||||
if (this.connections) outstr += " connections=" + this.connections;
|
||||
if (k == "wtv-star") {
|
||||
outstr += "\nwtv-service: name=wtv-* host=" + this.host + " port=" + this.port;
|
||||
if (this.flags) outstr += " flags=" + this.flags;
|
||||
if (this.connections) outstr += " flags=" + this.connections;
|
||||
if (this.connections) outstr += " connections=" + this.connections;
|
||||
}
|
||||
return outstr;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user