jaredhanson / jaredhanson/connect-flash

What is the `unsafe` option?

Open
#51 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
1.2k
Forks
173
PR merge metrics
No merged PRs in 30d

Description

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();
}

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at the middleware code containing the shown req.flash assignment and trace how the unsafe option is handled. Clarify what the option changes, when it should be used, and document the behavior and example usage in the project’s documentation.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
backend
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.