Skip to content

Commit

Permalink
fix Container.addFile to pass arguments properly
Browse files Browse the repository at this point in the history
  • Loading branch information
adregner committed Mar 23, 2013
1 parent db242b3 commit 4f5e7cf
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lib/cloudfiles/container.js
Expand Up @@ -23,7 +23,16 @@ var Container = exports.Container = function (client, details) {

Container.prototype = {
addFile: function (file, local, options, callback) {
return this.client.addFile(this.name, file, local, options, callback);
if(!options && !callback) {
options = {};
}
if (typeof options === 'function' && !callback) {
callback = options;
options = {};
}
options.remote = file;
options.local = local;
return this.client.addFile(this.name, options, callback);
},

destroy: function (callback) {
Expand Down

0 comments on commit 4f5e7cf

Please sign in to comment.