-
Notifications
You must be signed in to change notification settings - Fork 19
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
Update read-only.js #10
base: master
Are you sure you want to change the base?
Conversation
Added check to see if body is empty to prevent sql error 'syntax error at or near "WHERE"'
Removing whitespace
Removing last trailing whitespace
@ mrfelton I wonder if these are valid tests? If we're only updating readonly model attributes, shouldn't we return a 403? Can I amend the test? |
if (properties) { | ||
debug('Creating %s : Read only properties are %j', Model.modelName, properties); | ||
Object.keys(properties).forEach(function(key) { | ||
if (!properties) return next(err); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the response a 403 given a model using this mixin where the mixin options = an empty object?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error seems inappropriate in general if the goal is to address an empty body and subsequent SQL errors when using SQL connectors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we create a new error and response code you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, just noticed the SQL errors will happen for empty bodies against the remote to update attributes when using the SQL connectors... maybe the solution should be somewhere else at a lower level?
Added check to see if body is empty to prevent sql error 'syntax error at or near "WHERE"'