不要怂,就是干,撸起袖子干!

Commit dfffa2b2 by Mick Hansen

fix(validation): binary data is ok for strings

1 parent f3b924d5
Showing with 1 additions and 1 deletions
......@@ -365,7 +365,7 @@ InstanceValidator.prototype._validateSchema = function(rawAttribute, field, valu
}
if (rawAttribute.type === DataTypes.STRING || rawAttribute.type instanceof DataTypes.STRING || rawAttribute.type === DataTypes.TEXT) {
if (Array.isArray(value) || (_.isObject(value) && !value._isSequelizeMethod)) {
if (Array.isArray(value) || (_.isObject(value) && !value._isSequelizeMethod) && !Buffer.isBuffer(value)) {
error = new sequelizeError.ValidationErrorItem(field + ' cannot be an array or an object', 'string violation', field, value);
this.errors.push(error);
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!