-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Code execution continues when it should stop in POST action #407
Comments
The problem can be avoided by putting return on the next line:
And I am not sure whether 403 (unauthorized) is appropriate here, shouldn't be 400 when invalid data is sent? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello.
If you try to post empty data via API, not React client application, the application will crash. The particular line in problem is in post.controller.js file, where you check if name, title or content are empty. The line:
res.status(403).end();
should abort execution. Possible solution could be:
return res.status(403).end();
but it raises eslint consistent-return warning.
The text was updated successfully, but these errors were encountered: