connect-flash icon indicating copy to clipboard operation
connect-flash copied to clipboard

What is the `unsafe` option?

Open RevealedFrom opened this issue 5 years ago • 0 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();
}

RevealedFrom avatar Feb 04 '21 12:02 RevealedFrom