[fix] refactor

This commit is contained in:
yawnt 2013-06-24 11:16:23 +02:00 committed by cronopio
parent ebbba73eda
commit a56ae94894

View File

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