Skip to content

Commit 7224fac

Browse files
authored
Merge pull request #91 from minrk/handle_proxy_error-this
fix closure reference when serving custom error pages
2 parents b105a62 + fbc874a commit 7224fac

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/configproxy.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ ConfigurableProxy.prototype.handle_proxy_error = function (code, kind, req, res)
368368
error_request.on('error', function(e) {
369369
// custom error failed, fallback on default
370370
log.error("Failed to get custom error page", e);
371-
this._handle_proxy_error_default(code, kind, req, res);
371+
proxy._handle_proxy_error_default(code, kind, req, res);
372372
});
373373
error_request.end();
374374
} else if (this.error_path) {
@@ -378,7 +378,7 @@ ConfigurableProxy.prototype.handle_proxy_error = function (code, kind, req, res)
378378
filename = path.join(this.error_path, 'error.html');
379379
if (!fs.existsSync(filename)) {
380380
log.error("No error file %s", filename);
381-
this._handle_proxy_error_default(code, kind, req, res);
381+
proxy._handle_proxy_error_default(code, kind, req, res);
382382
return;
383383
}
384384
}

0 commit comments

Comments
 (0)