diff --git a/routes/guestbook.js b/routes/guestbook.js index 58ddefa..caa08f5 100644 --- a/routes/guestbook.js +++ b/routes/guestbook.js @@ -46,7 +46,7 @@ async function submit(req, res, next) { if (message.length >= 512) { errors.push('Maximum length is 512 characters.'); } - if (name == '') { + if (name.match(/^\s*$/g)) { errors.push('Name must be specified.'); } if ( @@ -65,12 +65,12 @@ async function submit(req, res, next) { send_error(res, "
" + errors.join('
') + "