fix encryption errors
This commit is contained in:
@@ -761,16 +761,8 @@ async function sendToClient(socket, headers_obj, data) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// if box can do compression, see if its worth enabling
|
// if box can do compression, see if its worth enabling
|
||||||
<<<<<<< HEAD
|
|
||||||
var compression_type = shouldWeCompress(socket.ssid, headers_obj);
|
var compression_type = shouldWeCompress(socket.ssid, headers_obj);
|
||||||
if (headers_obj["wtv-modern-content-type"]) delete headers_obj["wtv-modern-content-type"];
|
if (headers_obj["wtv-modern-content-type"]) delete headers_obj["wtv-modern-content-type"];
|
||||||
=======
|
|
||||||
if (ssid_sessions[socket.ssid].capabilities) {
|
|
||||||
if (ssid_sessions[socket.ssid].capabilities['client-can-receive-compressed-data'] && minisrv_config.config.enable_lzpf_compression) {
|
|
||||||
compress_data = shouldWeCompress(headers_obj);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
>>>>>>> 6a39cc5... Scratch that. Do what offers better compression over replicating the service. RC4 is too random
|
|
||||||
|
|
||||||
// compress if needed
|
// compress if needed
|
||||||
if (compression_type > 0 && content_length > 0 && headers_obj['http_response'].substring(0,3) == "200") {
|
if (compression_type > 0 && content_length > 0 && headers_obj['http_response'].substring(0,3) == "200") {
|
||||||
@@ -817,17 +809,6 @@ async function sendToClient(socket, headers_obj, data) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// encrypt if needed
|
|
||||||
if (socket_sessions[socket.id].secure == true) {
|
|
||||||
headers_obj["wtv-encrypted"] = 'true';
|
|
||||||
headers_obj = moveObjectElement('wtv-encrypted', 'Connection', headers_obj);
|
|
||||||
if (clen > 0 && socket_sessions[socket.id].wtvsec) {
|
|
||||||
if (!zquiet) console.log(" * Encrypting response to client ...")
|
|
||||||
var enc_data = socket_sessions[socket.id].wtvsec.Encrypt(1, data);
|
|
||||||
data = enc_data;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// calculate content length
|
// calculate content length
|
||||||
// make sure we are using our Content-length and not one set in a script.
|
// make sure we are using our Content-length and not one set in a script.
|
||||||
if (headers_obj["Content-Length"]) delete headers_obj["Content-Length"];
|
if (headers_obj["Content-Length"]) delete headers_obj["Content-Length"];
|
||||||
|
|||||||
Reference in New Issue
Block a user