fgsants / REST-API-FreeRADIUS

A simple REST Server for the FreeRADIUS rlm_rest module
GNU General Public License v3.0
115 stars 51 forks source link

Timed out response #5

Open jjreed05 opened 5 years ago

jjreed05 commented 5 years ago

After testing the code, I found that when you run a check on a username that does not exist. The server times out and does not send the proper response back to the client. The code: exports.check = function(req, res) { Users.findOne({ login: req.params.login }, function(err, acc) { if (err) res.send(err); if (acc == null){return res.status(401); res.json({'Reply-Message': 'Login invalid'});} res.set('Content-Type', 'application/json'); res.sendStatus(204); }); };

The bug lies inside the second if statement.

deweydb commented 4 years ago

confirming same issue.