Skip to content

Commit

Permalink
[fix] Check type on .createContainer()
Browse files Browse the repository at this point in the history
  • Loading branch information
indexzero committed Mar 30, 2011
1 parent 2b4f9fb commit 16193e2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/cloudfiles/core.js
Expand Up @@ -112,14 +112,14 @@ Cloudfiles.prototype.getContainer = function () {
};

Cloudfiles.prototype.createContainer = function (container, callback) {
var self = this;
utils.rackspace('PUT', this.storageUrl(container.name), this, callback, function (body, res) {
var self = this, containerName = container instanceof cloudfiles.Container ? container.name : container;
utils.rackspace('PUT', this.storageUrl(containerName), this, callback, function (body, res) {
if (typeof container.cdnEnabled !== 'undefined' && container.cdnEnabled) {
container.ttl = container.ttl || self.config.cdn.ttl;
container.logRetention = container.logRetention || self.config.cdn.logRetention;

var cdnOptions = {
uri: self.cdnUrl(container.name),
uri: self.cdnUrl(containerName),
method: 'PUT',
client: self,
headers: {
Expand Down

0 comments on commit 16193e2

Please sign in to comment.