From f266024c1b90fd2bc45814fa0af3cfcc53925453 Mon Sep 17 00:00:00 2001 From: Raymond Feng Date: Tue, 24 Jun 2014 15:53:26 -0700 Subject: [PATCH 1/2] Fix amazon s3 container handling See https://github.com/strongloop/loopback-storage-service/issues/16 --- lib/factory.js | 5 +++++ lib/storage-service.js | 1 + 2 files changed, 6 insertions(+) diff --git a/lib/factory.js b/lib/factory.js index daf23f1..e03bc71 100644 --- a/lib/factory.js +++ b/lib/factory.js @@ -25,6 +25,11 @@ function patchBaseClass(cls) { proto._setProperties = function (details) { // Use an empty object to receive the calculated properties from details var receiver = {}; + // Pass in some context as non-enumerable properties + Object.defineProperties(receiver, { + client: {value: this.client}, + files: {value: this.files} + }); m1.call(receiver, details); // Apply the calculated properties to this for (var p in receiver) { diff --git a/lib/storage-service.js b/lib/storage-service.js index 1cc5978..0f1ee66 100644 --- a/lib/storage-service.js +++ b/lib/storage-service.js @@ -64,6 +64,7 @@ StorageService.prototype.getContainers = function (cb) { StorageService.prototype.createContainer = function (options, cb) { options = options || {}; if ('object' === typeof options && !(options instanceof storage.Container)) { + options.Name = options.name; // Amazon expects Name var Container = factory.getProvider(this.provider).storage.Container; options = new Container(this.client, options); } From 702deccd828f4c3057076387dc7df29b92f0735c Mon Sep 17 00:00:00 2001 From: Raymond Feng Date: Thu, 26 Jun 2014 23:53:11 -0700 Subject: [PATCH 2/2] Bump version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e91e0e1..5d61844 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "loopback-storage-service", "description": "Loopback Storage Service", - "version": "1.0.3", + "version": "1.0.4", "main": "index.js", "scripts": { "test": "./node_modules/.bin/mocha --timeout 30000 test/*test.js"