mirror of
https://github.com/http-party/node-http-proxy.git
synced 2025-12-08 20:59:18 +00:00
[fix] refactor
This commit is contained in:
parent
ebbba73eda
commit
a56ae94894
@ -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() }
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user