Reroute to 404 if no route is to handle the URI
This commit is contained in:
parent
56fe5a4b44
commit
bbb604af66
@ -82,6 +82,7 @@ Router.prototype.route = function()
|
||||
}
|
||||
}
|
||||
|
||||
this.setRoute( "*", currentRoute );
|
||||
this.routable = false;
|
||||
return false;
|
||||
};
|
||||
|
@ -18,6 +18,7 @@ var Framework = function( garden )
|
||||
{
|
||||
this.HTTP.response.statusCode = 404;
|
||||
this.result = "404 Not Found";
|
||||
this.plantResult();
|
||||
}.bind( this )
|
||||
}
|
||||
};
|
||||
@ -70,6 +71,12 @@ Framework.prototype.parseResult = function()
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else if( method === false )
|
||||
{
|
||||
Dragonfly.Log( "No route is defined to handle this URI", Dragonfly.Spheres.THERMO );
|
||||
this.router.routeObj.reroute( "404", true );
|
||||
continue;
|
||||
}
|
||||
|
||||
throw new FatalError( "Relay handler \"" + method + "\" is not defined" );
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user