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() }