Permalink
Browse files

[fix] Check type on `.createContainer()`

  • Loading branch information...
1 parent 2b4f9fb commit 16193e2d59c98842659a2d9fecbc588025e2268a @indexzero indexzero committed Mar 30, 2011
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/cloudfiles/core.js
View
@@ -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: {

0 comments on commit 16193e2

Please sign in to comment.