Skip to content
Permalink
Browse files

Sets status code to 301 rather than 302 for redirects

  • Loading branch information
davidmerfield committed Dec 9, 2019
1 parent 3f56714 commit d7bdb0d18b64a594aecf7921c9fc2c7723c6d227
Showing with 3 additions and 1 deletion.
  1. +3 −1 app/blog/error.js
@@ -22,7 +22,9 @@ module.exports = function(server) {
// want an infinite redirect loop we continue
if (redirect === req.url) return next();

res.redirect(redirect);
// By default, res.redirect returns a 302 status
// code (temporary) rather than 301 (permanent)
res.redirect(301, redirect);
});
});

0 comments on commit d7bdb0d

Please sign in to comment.
You can’t perform that action at this time.