Applying review comments.
This commit is contained in:
Родитель
07a61c34b7
Коммит
1ecbcf50c0
|
@ -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,7 +1273,7 @@ suite('blobservice-tests', function () {
|
|||
});
|
||||
});
|
||||
});
|
||||
|
||||
*/
|
||||
test('storageConnectionStrings', function (done) {
|
||||
var connectionString = 'DefaultEndpointsProtocol=https;AccountName=myaccount;AccountKey=mykey';
|
||||
var blobService = azure.createBlobService(connectionString);
|
||||
|
@ -1280,6 +1281,7 @@ suite('blobservice-tests', function () {
|
|||
assert.equal(blobService.storageAccount, 'myaccount');
|
||||
assert.equal(blobService.storageAccessKey, 'mykey');
|
||||
assert.equal(blobService.protocol, 'https://');
|
||||
assert.equal(blobService.host, 'blob.core.windows.net');
|
||||
|
||||
done();
|
||||
});
|
||||
|
|
Загрузка…
Ссылка в новой задаче