From a56ae94894fab89bc0ebc34f9b69cfccf3cb239a Mon Sep 17 00:00:00 2001 From: yawnt Date: Mon, 24 Jun 2013 11:16:23 +0200 Subject: [PATCH] [fix] refactor --- lib/node-http-proxy/http-proxy.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/node-http-proxy/http-proxy.js b/lib/node-http-proxy/http-proxy.js index 0efb2fa..f481ccf 100644 --- a/lib/node-http-proxy/http-proxy.js +++ b/lib/node-http-proxy/http-proxy.js @@ -66,7 +66,7 @@ var HttpProxy = exports.HttpProxy = function (options) { // this.forward = options.forward; this.target = options.target; - this.timeout = options.timeout; + this.timeout = options.timeout; // // Setup the necessary instances instance variables for @@ -207,12 +207,10 @@ HttpProxy.prototype.proxyRequest = function (req, res, buffer) { // This NODE_ENV=production behavior is mimics Express and // Connect. // - if (process.env.NODE_ENV === 'production') { - res.write('Internal Server Error'); - } - else { - res.write('An error has occurred: ' + JSON.stringify(err)); - } + res.write(process.env.NODE_ENV === 'production' + ? 'Internal Server Error' + : 'An error has occurred: ' + JSON.stringify(err) + ); } try { res.end() }