mirror of
https://github.com/zoriya/flood.git
synced 2026-06-01 18:47:44 +00:00
Ensure req.body is defined
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
module.exports = key => {
|
||||
return (req, res, next) => {
|
||||
const value = req.body[key];
|
||||
const value = req.body && req.body[key];
|
||||
|
||||
if (value && typeof value === 'string') {
|
||||
req.body[key] = value === 'true';
|
||||
|
||||
Reference in New Issue
Block a user