Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix error-pages 404 status

  • Loading branch information...
commit 1b15af713c0fb5759c0ec7e1bff55dbe7227cc36 1 parent 89c5aff
@nickjj nickjj authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 examples/error-pages/index.js
View
5 examples/error-pages/index.js
@@ -1,4 +1,3 @@
-
/**
* Module dependencies.
*/
@@ -32,9 +31,11 @@ app.use(app.router);
// $ curl http://localhost:3000/notfound -H "Accept: text/plain"
app.use(function(req, res, next){
+ // apply the 404 status code to all forms of accept headers
+ res.status(404);
+
// respond with html page
if (req.accepts('html')) {
- res.status(404);
res.render('404', { url: req.url });
return;
}
Please sign in to comment.
Something went wrong with that request. Please try again.