yet another possible POST fix
This commit is contained in:
@@ -1167,7 +1167,7 @@ async function processRequest(socket, data_hex, skipSecure = false, encryptedReq
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// handle streaming POST
|
// handle streaming POST
|
||||||
if (typeof socket_sessions[socket.id].post_data != "undefined" && headers) {
|
if (socket_sessions[socket.id].expecting_post_data && headers) {
|
||||||
socket_sessions[socket.id].headers = headers;
|
socket_sessions[socket.id].headers = headers;
|
||||||
if (socket_sessions[socket.id].post_data.length < (socket_sessions[socket.id].post_data_length * 2)) {
|
if (socket_sessions[socket.id].post_data.length < (socket_sessions[socket.id].post_data_length * 2)) {
|
||||||
new_header_obj = null;
|
new_header_obj = null;
|
||||||
@@ -1213,12 +1213,14 @@ async function processRequest(socket, data_hex, skipSecure = false, encryptedReq
|
|||||||
} else {
|
} else {
|
||||||
if (minisrv_config.config.debug_flags.debug) console.log(" # Unencrypted POST Content", "on", socket.id);
|
if (minisrv_config.config.debug_flags.debug) console.log(" # Unencrypted POST Content", "on", socket.id);
|
||||||
}
|
}
|
||||||
|
socket_sessions[socket.id].expecting_post_data = false;
|
||||||
delete socket_sessions[socket.id].headers;
|
delete socket_sessions[socket.id].headers;
|
||||||
delete socket_sessions[socket.id].post_data;
|
delete socket_sessions[socket.id].post_data;
|
||||||
delete socket_sessions[socket.id].post_data_length;
|
delete socket_sessions[socket.id].post_data_length;
|
||||||
processURL(socket, headers);
|
processURL(socket, headers);
|
||||||
return;
|
return;
|
||||||
} else if (socket_sessions[socket.id].post_data.length > (socket_sessions[socket.id].post_data_length * 2)) {
|
} else if (socket_sessions[socket.id].post_data.length > (socket_sessions[socket.id].post_data_length * 2)) {
|
||||||
|
socket_sessions[socket.id].expecting_post_data = false;
|
||||||
if (socket_sessions[socket.id].expecting_post_data) delete socket_sessions[socket.id].expecting_post_data;
|
if (socket_sessions[socket.id].expecting_post_data) delete socket_sessions[socket.id].expecting_post_data;
|
||||||
socket.setTimeout(minisrv_config.config.socket_timeout * 1000);
|
socket.setTimeout(minisrv_config.config.socket_timeout * 1000);
|
||||||
// got too much data ? ... should not ever reach this code
|
// got too much data ? ... should not ever reach this code
|
||||||
|
|||||||
Reference in New Issue
Block a user