Skip to content
Snippets Groups Projects
Commit 0340a177 authored by Ben Adida's avatar Ben Adida
Browse files

added custom 404 handlers for main site and verifier that do not echo the URL back in content

parent c7495ab4
No related branches found
No related tags found
No related merge requests found
......@@ -168,6 +168,13 @@ shutdown.installUpdateHandler(app, function(readyForShutdown) {
db.close(readyForShutdown)
});
// #11.5 - custom 404
app.use(function(req, res,next) {
res.statusCode = 404;
res.write("Cannot find this resource");
res.end();
});
// #12 if the BROWSERID_FAKE_VERIFICATION env var is defined, we'll include
// fake_verification.js. This is used during testing only and should
// never be included in a production deployment
......
......@@ -123,6 +123,13 @@ app.post('/verify', function(req, resp, next) {
// shutdown when /code_update is invoked
shutdown.installUpdateHandler(app);
// custom 404
app.use(function(req, res,next) {
res.statusCode = 404;
res.write("Cannot find this resource");
res.end();
});
// shutdown nicely on signals
shutdown.handleTerminationSignals(app);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment