From c3a29498831ef1ad935b46d1f4898440a320eeec Mon Sep 17 00:00:00 2001 From: Stein Martin Hustad Date: Thu, 25 Oct 2012 01:39:03 +0200 Subject: [PATCH] No longer necessary to test for status code 304. The end event should also be emitted for 304 (Not modified) responses. Starting with commit 182dcd34555f361c1bb2b8d2777689e64ce32f87, there is no need to special handle these response statuses. Ensures that end is emitted also for 304 responses. --- lib/node-http-proxy/http-proxy.js | 7 ------- 1 file changed, 7 deletions(-) diff --git a/lib/node-http-proxy/http-proxy.js b/lib/node-http-proxy/http-proxy.js index 9a4f3087a..f5ead7601 100644 --- a/lib/node-http-proxy/http-proxy.js +++ b/lib/node-http-proxy/http-proxy.js @@ -259,13 +259,6 @@ HttpProxy.prototype.proxyRequest = function (req, res, buffer) { // Set the headers of the client response res.writeHead(response.statusCode, response.headers); - // If `response.statusCode === 304`: No 'data' event and no 'end' - if (response.statusCode === 304) { - try { res.end() } - catch (ex) { console.error("res.end error: %s", ex.message) } - return; - } - function ondata(chunk) { if (res.writable) { if (false === res.write(chunk) && response.pause) {