[fix] Emit notFound event when ProxyTable location does not exist. Fixes #355. Fixes #333.

This commit is contained in:
indexzero 2013-03-09 02:29:58 -05:00
parent 4c1a2c1416
commit 3130665d9f

View File

@ -195,8 +195,10 @@ RoutingProxy.prototype.proxyRequest = function (req, res, options) {
//
if (!location) {
try {
res.writeHead(404);
res.end();
if (!this.emit('notFound', req, res)) {
res.writeHead(404);
res.end();
}
}
catch (er) {
console.error("res.writeHead/res.end error: %s", er.message);