Skip to content

Commit

Permalink
Add the ability to have storage client set alternate serviceType
Browse files Browse the repository at this point in the history
- Fixes pkgcloud#258
  • Loading branch information
kenperkins committed Feb 28, 2014
1 parent 32c634e commit 1abf045
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/pkgcloud/openstack/storage/storageClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,17 @@ Client.prototype._getUrl = function (options) {
fragment = urlJoin(fragment, options.path.split('/').map(encodeURIComponent).join('/'));
}

var serviceUrl = options.serviceType ? this._identity.getServiceEndpointUrl({
serviceType: options.serviceType,
region: this.region
}) : this._serviceUrl;

if (fragment === '' || fragment === '/') {
return this._serviceUrl;
return serviceUrl;
}

return urlJoin(this._serviceUrl, fragment);
return urlJoin(serviceUrl, fragment);

};

Client.prototype.serializeMetadata = function (prefix, metadata) {
Expand Down

0 comments on commit 1abf045

Please sign in to comment.