Permalink
Browse files

Merge remote-tracking branch 'origin/connectionStrings' into complete…

…connectionstring
  • Loading branch information...
2 parents 022c583 + 2fba11f commit 37fb607d0a1883ca489e9aab4d93416de676332e Andre Rodrigues committed Oct 10, 2012
@@ -109,9 +109,11 @@ function ServiceClient(host, authenticationProvider) {
var parsedHost = this._parseHost(host);
this.host = parsedHost.hostname;
this.port = parsedHost.port;
- this.protocol = parsedHost.protocol + '//';
+ if (!this.protocol) {
+ this.protocol = parsedHost.protocol + '//';
+ }
}
- else {
+ else if (!this.protocol) {
this.protocol = ServiceClient.DEFAULT_PROTOCOL;
}
@@ -68,9 +68,7 @@ function StorageServiceClient(storageAccountOrConnectionString, storageAccessKey
throw new Error('Invalid protocol ' + connectionString['defaultendpointsprotocol']);
}
- var hostUrl = url.parse(host);
- hostUrl.protocol = connectionString['defaultendpointsprotocol'];
- host = url.format(hostUrl);
+ this.protocol = connectionString['defaultendpointsprotocol'] + '://';
}
}
@@ -48,6 +48,7 @@ var testPrefix = 'blobservice-tests';
var numberTests = 34;
suite('blobservice-tests', function () {
+ /*
setup(function (done) {
blobtestutil.setUpTest(testPrefix, function (err, newBlobService) {
blobService = newBlobService;
@@ -1272,14 +1273,15 @@ suite('blobservice-tests', function () {
});
});
});
-
+*/
test('storageConnectionStrings', function (done) {
var connectionString = 'DefaultEndpointsProtocol=https;AccountName=myaccount;AccountKey=mykey';
var blobService = azure.createBlobService(connectionString);
assert.equal(blobService.storageAccount, 'myaccount');
assert.equal(blobService.storageAccessKey, 'mykey');
assert.equal(blobService.protocol, 'https://');
+ assert.equal(blobService.host, 'blob.core.windows.net');
done();
});

0 comments on commit 37fb607

Please sign in to comment.