Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #1309 from nickjj/patch-1

fix error-pages 404 status
  • Loading branch information...
commit dd338b5567605044a47950638ea8bb775239dded 2 parents 89c5aff + 1b15af7
@tj tj 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.