Merge branch 'max-fields-size-override' of https://github.com/obernal/loopback-component-storage into obernal-max-fields-size-override

# Conflicts:
#	lib/storage-service.js
This commit is contained in:
Raymond Feng 2017-03-01 15:19:52 -08:00
commit 4ef64a8d50
1 changed files with 5 additions and 0 deletions

View File

@ -49,6 +49,9 @@ function StorageService(options) {
if (options.nameConflict) { if (options.nameConflict) {
this.nameConflict = options.nameConflict; this.nameConflict = options.nameConflict;
} }
if (options.maxFieldsSize) {
this.maxFieldsSize = options.maxFieldsSize;
}
} }
function map(obj) { function map(obj) {
@ -246,6 +249,8 @@ StorageService.prototype.upload = function(req, res, options, cb) {
} }
if (this.nameConflict && !options.nameConflict) { if (this.nameConflict && !options.nameConflict) {
options.nameConflict = this.nameConflict; options.nameConflict = this.nameConflict;
if (this.maxFieldsSize && !options.maxFieldsSize) {
options.maxFieldsSize = this.maxFieldsSize;
} }
return handler.upload(this.client, req, res, options, cb); return handler.upload(this.client, req, res, options, cb);
}; };