From 99fe599c5e4efab0fd285bc58f39ea09e2655dad Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Thu, 11 Jun 2020 11:53:43 -0700 Subject: [PATCH] Provide an explicit (empty) return body for some responses If we just do the numeric sendStatus(200) then node goes and sends a response with a body of "OK" rather than something empty. I don't necessarily want that, (and I notice that when I have spurious "OK" strings cluttering up my test-suite output). --- empathy.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/empathy.js b/empathy.js index 7dbf5d8..3a3f80d 100644 --- a/empathy.js +++ b/empathy.js @@ -228,7 +228,7 @@ router.post('/vote/:prompt_id([0-9]+)', (request, response) => { const prompt_id = parseInt(request.params.prompt_id, 10); if (game.toggle_vote(prompt_id, request.session.id)) - response.sendStatus(200); + response.send(''); else response.sendStatus(404); }); @@ -238,7 +238,7 @@ router.post('/start/:prompt_id([0-9]+)', (request, response) => { const prompt_id = parseInt(request.params.prompt_id, 10); if (game.start(prompt_id)) - response.sendStatus(200); + response.send(''); else response.sendStatus(404); }); -- 2.43.0