Skip to content

Commit

Permalink
[fix] refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
yawnt committed Jun 24, 2013
1 parent de0928f commit d561e27
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions lib/node-http-proxy/http-proxy.js
Expand Up @@ -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
Expand Down Expand Up @@ -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() }
Expand Down

0 comments on commit d561e27

Please sign in to comment.