diff --git a/zefie_wtvp_minisrv/app.js b/zefie_wtvp_minisrv/app.js index 84410fb0..d76d04ea 100644 --- a/zefie_wtvp_minisrv/app.js +++ b/zefie_wtvp_minisrv/app.js @@ -1071,14 +1071,11 @@ async function processRequest(socket, data_hex, skipSecure = false, encryptedReq socket_sessions[socket.id].post_data = ""; socket_sessions[socket.id].headers = headers; var post_string = "POST"; + if (socket_sessions[socket.id].secure) post_string = "Encrypted " + post_string; + // the client may have just sent the data with the primary headers, so lets look for that. if (data_hex.indexOf("0d0a0d0a") != -1) socket_sessions[socket.id].post_data = data_hex.substring(data_hex.indexOf("0d0a0d0a") + 8); if (data_hex.indexOf("0a0a") != -1) socket_sessions[socket.id].post_data = data_hex.substring(data_hex.indexOf("0a0a") + 4); - if (socket_sessions[socket.id].secure) { - // decrypt if encrypted - post_string = "Encrypted " + post_string; - socket_sessions[socket.id].post_data = CryptoJS.lib.WordArray.create(socket_sessions[socket.id].wtvsec.Decrypt(0, CryptoJS.enc.Hex.parse(socket_sessions[socket.id].post_data))).toString(CryptoJS.enc.Hex); - } } if (socket_sessions[socket.id].post_data.length == (socket_sessions[socket.id].post_data_length * 2)) {