Skip to content

Commit

Permalink
fix closure reference when serving custom error pages
Browse files Browse the repository at this point in the history
this != that!
  • Loading branch information
minrk committed Dec 9, 2016
1 parent b105a62 commit fbc874a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/configproxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ ConfigurableProxy.prototype.handle_proxy_error = function (code, kind, req, res)
error_request.on('error', function(e) {
// custom error failed, fallback on default
log.error("Failed to get custom error page", e);
this._handle_proxy_error_default(code, kind, req, res);
proxy._handle_proxy_error_default(code, kind, req, res);
});
error_request.end();
} else if (this.error_path) {
Expand All @@ -378,7 +378,7 @@ ConfigurableProxy.prototype.handle_proxy_error = function (code, kind, req, res)
filename = path.join(this.error_path, 'error.html');
if (!fs.existsSync(filename)) {
log.error("No error file %s", filename);
this._handle_proxy_error_default(code, kind, req, res);
proxy._handle_proxy_error_default(code, kind, req, res);
return;
}
}
Expand Down

0 comments on commit fbc874a

Please sign in to comment.