Permalink
Browse files

Adding protocol check.

  • Loading branch information...
1 parent d36aa97 commit 07a61c34b7d3c0e4f6e60f3ad7641d1424ed6fed Andre Rodrigues committed Oct 10, 2012
Showing with 5 additions and 0 deletions.
  1. +5 −0 lib/services/core/storageserviceclient.js
@@ -63,6 +63,11 @@ function StorageServiceClient(storageAccountOrConnectionString, storageAccessKey
}
if (connectionString['defaultendpointsprotocol']) {
+ if (connectionString['defaultendpointsprotocol'] !== 'http' &&
+ connectionString['defaultendpointsprotocol'] !== 'https') {
+ throw new Error('Invalid protocol ' + connectionString['defaultendpointsprotocol']);
+ }
+
var hostUrl = url.parse(host);
hostUrl.protocol = connectionString['defaultendpointsprotocol'];
host = url.format(hostUrl);

0 comments on commit 07a61c3

Please sign in to comment.