Skip to content

Timed out response #5

Description

@jjreed05

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions