From 9dde2120b37c97717d79eaf0201810abf02cfe1d Mon Sep 17 00:00:00 2001 From: Infant Frontender <34810942+newbornfrontender@users.noreply.github.com> Date: Tue, 1 Jan 2019 12:31:28 +0300 Subject: [PATCH] fix: add missing spaces in code examples --- readme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/readme.md b/readme.md index 8c137fc..07df276 100644 --- a/readme.md +++ b/readme.md @@ -300,7 +300,7 @@ const sleep = ms => new Promise(r => setTimeout(r, ms)); async function authenticate(req, res, next) { let token = req.headers['authorization']; - if (!token) return (res.statusCode=401,res.end('No token!')); + if (!token) return (res.statusCode=401, res.end('No token!')); req.user = await Users.find(token); // <== fake next(); // done, woot! } @@ -459,7 +459,7 @@ There are three ways to "throw" an error from within a middleware function. 'Content-Type': 'application/json', 'X-Error-Code': 'Please dont do this IRL' }); - let json = JSON.stringify({ error:'Missing CSRF token' }); + let json = JSON.stringify({ error: 'Missing CSRF token' }); res.end(json); } else { next(); // never called FYI