Permalink
Browse files

Avoiding breaking change with devstore host detection.

  • Loading branch information...
1 parent 689693d commit 150e86d755f62a2821aabe4c265eae31d5ca6cf1 Andre Rodrigues committed Oct 13, 2012
Showing with 10 additions and 0 deletions.
  1. +10 −0 lib/services/core/storageserviceclient.js
@@ -81,6 +81,8 @@ StorageServiceClient.getStorageSettings = function (storageAccountOrConnectionSt
// Dev storage scenario
storageServiceSettings = StorageServiceSettings.getDevelopmentStorageAccountSettings();
} else {
+ var usePathStyleUri = false;
+
// Explicit credentials scenario
if (!storageAccountOrConnectionString) {
storageAccountOrConnectionString = process.env[ServiceClient.EnvironmentVariables.AZURE_STORAGE_ACCOUNT];
@@ -96,6 +98,13 @@ StorageServiceClient.getStorageSettings = function (storageAccountOrConnectionSt
var queueendpoint = url.format({ protocol: 'http:', host: storageAccountOrConnectionString + '.' + ServiceClient.CLOUD_QUEUE_HOST });
if (host) {
+ if (host === ServiceClient.DEVSTORE_BLOB_HOST ||
+ host === ServiceClient.DEVSTORE_TABLE_HOST ||
+ host === ServiceClient.DEVSTORE_QUEUE_HOST) {
+
+ usePathStyleUri = true;
+ }
+
var parsedHost = ServiceClient._parseHost(host);
blobendpoint = url.format({ protocol: parsedHost.protocol, port: parsedHost.port, hostname: storageAccountOrConnectionString + '.' + parsedHost.hostname });
@@ -112,6 +121,7 @@ StorageServiceClient.getStorageSettings = function (storageAccountOrConnectionSt
};
storageServiceSettings = StorageServiceSettings.createFromSettings(settings);
+ storageServiceSettings._usePathStyleUri = usePathStyleUri;
}
}

0 comments on commit 150e86d

Please sign in to comment.