[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,9 +195,11 @@ RoutingProxy.prototype.proxyRequest = function (req, res, options) {
// //
if (!location) { if (!location) {
try { try {
if (!this.emit('notFound', req, res)) {
res.writeHead(404); res.writeHead(404);
res.end(); res.end();
} }
}
catch (er) { catch (er) {
console.error("res.writeHead/res.end error: %s", er.message); console.error("res.writeHead/res.end error: %s", er.message);
} }