From f31893f5439c9e28a0b696f8721e8ed7a555bb21 Mon Sep 17 00:00:00 2001 From: xkxx Date: Fri, 7 Jun 2013 13:30:35 +0800 Subject: [PATCH] fix 411 length required --- server.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/server.js b/server.js index 67e9dfd..0eaeca1 100644 --- a/server.js +++ b/server.js @@ -254,6 +254,11 @@ var requestHandler = function(request, response, head) { remoteRes.pipe(response); }); + // disable default Transfer-Encoding header + if (!reqObj.headers['transfer-encoding']) { + remoteReq.removeHeader('transfer-encoding'); + } + // normally, browsers send CONNECT for ws: and wss: // here we implement upgrade only for compatibility's sake remoteReq.on('upgrade', function(remoteRes, remoteSoc) {