jaredhanson / connect-flash

Flash message middleware for Connect and Express.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

What is the `unsafe` option?

RevealedFrom opened this issue · comments

What is the unsafe option and when should it be used?

I looked through the source code and unsafe doesn't seem to make a difference. req.flash in the following is always undefined every time the middleware is called on every Http request, so that test condition will always be false.

function(req, res, next) {
  if (req.flash && safe) { return next(); }
  req.flash = _flash;
  next();
}