update: http(s) proxy: do not send internal 'wtv-connection-close' header to client
This commit is contained in:
@@ -413,6 +413,9 @@ async function sendToClient(socket, headers_obj, data) {
|
|||||||
headers_obj = headerStringToObj(headers_obj, true);
|
headers_obj = headerStringToObj(headers_obj, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var wtv_connection_close = headers_obj["wtv-connection-close"];
|
||||||
|
if (typeof(headers_obj["wtv-connection-close"]) != 'undefined') delete headers_obj["wtv-connection-close"];
|
||||||
|
|
||||||
// add Connection header if missing, default to Keep-Alive
|
// add Connection header if missing, default to Keep-Alive
|
||||||
if (!headers_obj.Connection) {
|
if (!headers_obj.Connection) {
|
||||||
headers_obj.Connection = "Keep-Alive";
|
headers_obj.Connection = "Keep-Alive";
|
||||||
@@ -501,7 +504,7 @@ async function sendToClient(socket, headers_obj, data) {
|
|||||||
socket_sessions[socket.id].buffer = null;
|
socket_sessions[socket.id].buffer = null;
|
||||||
if (socket_sessions[socket.id].close_me) socket.end();
|
if (socket_sessions[socket.id].close_me) socket.end();
|
||||||
if (headers_obj["Connection"]) {
|
if (headers_obj["Connection"]) {
|
||||||
if (headers_obj["Connection"].toLowerCase() == "close" && !headers["wtv-connection-close"] == "false") {
|
if (headers_obj["Connection"].toLowerCase() == "close" && wtv_connection_close == "true") {
|
||||||
socket.destroy();
|
socket.destroy();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user