From 539fb4e62a753f72371b77c736bc774b75705c01 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Sat, 26 May 2018 08:52:38 +0000 Subject: [PATCH] conn.resume() to fix close-or-hangup bug --- handlers.js | 2 +- lib/unwrap-tls.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/handlers.js b/handlers.js index cfa4785..2e88538 100644 --- a/handlers.js +++ b/handlers.js @@ -45,7 +45,7 @@ module.exports.create = function (state) { // Probably something that needs to be redirected to https function redirectHttpsAndClose(req, res) { - res.setHeader('Connection', 'close'); + //res.setHeader('Connection', 'close'); redirectHttps(req, res); } state.httpInsecureServer = http.createServer( diff --git a/lib/unwrap-tls.js b/lib/unwrap-tls.js index 11a1b3a..02312eb 100644 --- a/lib/unwrap-tls.js +++ b/lib/unwrap-tls.js @@ -72,6 +72,7 @@ module.exports.createTcpConnectionHandler = function (copts) { // defer after return (instead of being in many places) process.nextTick(function () { conn.unshift(firstChunk); + conn.resume(); }); var service = 'tcp';