This commit is contained in:
Andre Rodrigues 2012-10-12 17:26:03 +01:00
Родитель df5b1307ba
Коммит ef43ac4b5b
7 изменённых файлов: 26 добавлений и 89 удалений

Просмотреть файл

@ -2176,7 +2176,7 @@ BlobService.prototype.generateSharedAccessSignature = function (container, blob,
var resourceName = createResourceName(container, blob);
var signedQueryString = this.sharedAccessSignatureCredentials.generateSignedQueryString(resourceName, {}, resourceType, sharedAccessPolicy);
var baseUrl = this.protocol + this._getHostname() + ':' + this.port;
var baseUrl = this.protocol + this.host + ':' + this.port;
var path = this._getPath('/' + resourceName);
return {
@ -2203,7 +2203,7 @@ BlobService.prototype.getBlobUrl = function (container, blob) {
var resourceName = createResourceName(container, blob);
var baseUrl = this.protocol + this._getHostname() + ':' + this.port;
var baseUrl = this.protocol + this.host + ':' + this.port;
var path = this._getPath('/' + resourceName);
return {

Просмотреть файл

@ -69,7 +69,7 @@ ServiceBusServiceClient.prototype._buildRequestOptions = function (webResource,
}
webResource.addOptionalHeader(HeaderConstants.ACCEPT_CHARSET_HEADER, 'UTF-8');
webResource.addOptionalHeader(HeaderConstants.HOST_HEADER, this._getHostname() + ':' + this.port);
webResource.addOptionalHeader(HeaderConstants.HOST_HEADER, this.host + ':' + this.port);
// Sets the request url in the web resource.
this._setRequestUrl(webResource);
@ -90,7 +90,7 @@ ServiceBusServiceClient.prototype._buildRequestOptions = function (webResource,
requestOptions = {
url: url.format({
protocol: self._isHttps() ? 'https:' : 'http:',
hostname: self._getHostname(),
hostname: self.host,
port: self.port,
pathname: webResource.path + webResource.getQueryString(true)
}),
@ -121,13 +121,4 @@ ServiceBusServiceClient.prototype._getPath = function (path) {
}
return path;
};
/**
* Retrives the hostname.
*
* @return {string} The hostname.
*/
ServiceBusServiceClient.prototype._getHostname = function () {
return this.namespace + '.' + this.host;
};

Просмотреть файл

@ -514,7 +514,7 @@ ServiceClient.prototype._setRequestUrl = function (webResource) {
var queryString = webResource.getQueryString(true);
// Build the full request url
webResource.requestUrl = this.protocol + this._getHostname() + ":" + this.port + webResource.path + queryString;
webResource.requestUrl = this.protocol + this.host + ":" + this.port + webResource.path + queryString;
};
/**

Просмотреть файл

@ -190,7 +190,7 @@ ServiceManagementClient.prototype._buildRequestOptions = function(webResource, o
var requestOptions = {
url: url.format({
protocol: self._isHttps() ? 'https' : 'http',
hostname: self._getHostname(),
hostname: self.host,
port: self.port,
pathname: webResource.path + webResource.getQueryString(true)
}),
@ -302,12 +302,4 @@ ServiceManagementClient.prototype._setAgent = function(self, reqopts, isHTTPS) {
} else if (isHTTPS) {
reqopts.agent = new https.Agent(reqopts);
}
};
/**
* Get service host name
*/
ServiceManagementClient.prototype._getHostname = function () {
return this.host;
};
};

Просмотреть файл

@ -89,12 +89,24 @@ StorageServiceClient.getStorageSettings = function (storageAccountOrConnectionSt
storageAccessKey = process.env[ServiceClient.EnvironmentVariables.AZURE_STORAGE_ACCESS_KEY];
}
// Default endpoints
var blobendpoint: url.format({ protocol: 'http:', host: storageAccountOrConnectionString + '.' + ServiceClient.CLOUD_BLOB_HOST });
var tableendpoint: url.format({ protocol: 'http:', host: storageAccountOrConnectionString + '.' + ServiceClient.CLOUD_TABLE_HOST });
var queueendpoint: url.format({ protocol: 'http:', host: storageAccountOrConnectionString + '.' + ServiceClient.CLOUD_QUEUE_HOST });
if (host) {
var parsedHost = this._parseHost(host);
blobendpoint: url.format({ protocol: parsedHost.protocol, port: parsedHost.port, host: storageAccountOrConnectionString + '.' + ServiceClient.CLOUD_BLOB_HOST });
tableendpoint: url.format({ protocol: parsedHost.protocol, port: parsedHost.port, host: storageAccountOrConnectionString + '.' + ServiceClient.CLOUD_TABLE_HOST });
queueendpoint: url.format({ protocol: parsedHost.protocol, port: parsedHost.port, host: storageAccountOrConnectionString + '.' + ServiceClient.CLOUD_QUEUE_HOST });
}
var settings = {
accountname: storageAccountOrConnectionString,
accountkey: storageAccessKey,
blobendpoint: url.format({ protocol: 'https:', host: storageAccountOrConnectionString + '.' + ServiceClient.CLOUD_BLOB_HOST }),
tableendpoint: url.format({ protocol: 'https:', host: storageAccountOrConnectionString + '.' + ServiceClient.CLOUD_TABLE_HOST }),
queueendpoint: url.format({ protocol: 'https:', host: storageAccountOrConnectionString + '.' + ServiceClient.CLOUD_QUEUE_HOST })
blobendpoint: blobendpoint
tableendpoint: tableendpoint
queueendpoint: queueendpoint
};
storageServiceSettings = StorageServiceSettings.createFromSettings(settings);
@ -130,7 +142,7 @@ StorageServiceClient.prototype._buildRequestOptions = function (webResource, opt
webResource.addOptionalHeader(HeaderConstants.ACCEPT_HEADER, 'application/atom+xml,application/xml');
webResource.addOptionalHeader(HeaderConstants.ACCEPT_CHARSET_HEADER, 'UTF-8');
webResource.addOptionalHeader(HeaderConstants.HOST_HEADER, this._getHostname() + ':' + this.port);
webResource.addOptionalHeader(HeaderConstants.HOST_HEADER, this.host + ':' + this.port);
if (options) {
if (options.timeoutIntervalInMs) {
@ -157,7 +169,7 @@ StorageServiceClient.prototype._buildRequestOptions = function (webResource, opt
requestOptions = {
url: url.format({
protocol: self._isHttps() ? 'https:' : 'http:',
hostname: self._getHostname(),
hostname: self.host,
port: self.port,
pathname: webResource.path + webResource.getQueryString(true)
}),
@ -196,20 +208,6 @@ StorageServiceClient.prototype._getPath = function (path) {
return path;
};
/**
* Retrives the hostname taking into consideration the usePathStyleUri flag which indicates whether the account
* should be a prefix for it or not.
*
* @return {string} The hostname.
*/
StorageServiceClient.prototype._getHostname = function () {
if (this.usePathStyleUri) {
return this.host;
}
return this.storageAccount + '.' + this.host;
};
/**
* Sets the account credentials taking into consideration the isEmulated value and the environment variables:
* AZURE_STORAGE_ACCOUNT and AZURE_STORAGE_ACCESS_KEY.

Просмотреть файл

@ -112,7 +112,7 @@ WrapService.prototype._buildRequestOptions = function (webResource, options, cal
var requestOptions = {
url: url.format({
protocol: self._isHttps() ? 'https:' : 'http:',
hostname: self._getHostname(),
hostname: self.host,
port: self.port,
pathname: webResource.path + webResource.getQueryString(true)
}),
@ -141,15 +141,6 @@ WrapService.prototype._getPath = function (path) {
return path;
};
/**
* Retrives the hostname.
*
* @return {string} The hostname.
*/
WrapService.prototype._getHostname = function () {
return this.acsNamespace + '.' + this.host;
};
/**
* Validates a callback function.
*

Просмотреть файл

@ -1,36 +1 @@
cli/commands/generate-psm1-utils-test.js
serviceruntime/roleenvironment-tests.js
serviceruntime/runtimeversionmanager-tests.js
serviceruntime/runtimeversionprotocolclient-tests.js
services/blob/blobservice-tests.js
services/blob/sharedaccesssignature-tests.js
services/blob/sharedkey-tests.js
services/blob/sharedkeylite-tests.js
services/blob/filters-tests.js
services/core/connectionstringparser-tests.js
services/core/serviceclient-tests.js
services/core/exponentialretrypolicyfilter-tests.js
services/core/linearretrypolicyfilter-tests.js
services/core/servicesettings-tests.js
services/core/servicebussettings-tests.js
services/core/servicemanagementsettings-tests.js
services/core/storageservicesettings-tests.js
services/queue/queueservice-tests.js
services/table/batchserviceclient-tests.js
services/table/sharedkeytable-tests.js
services/table/sharedkeylitetable-tests.js
services/serviceBus/servicebusservice-tests.js
services/serviceBus/wrapservice-tests.js
services/serviceBus/wraptokenmanager-tests.js
services/table/tablequery-tests.js
services/table/tableservice-batch-tests.js
services/table/tableservice-tablequery-tests.js
services/table/tableservice-tests.js
util/atomhandler-tests.js
util/iso8061date-tests.js
util/util-tests.js
util/validate-tests.js
util/certificates/der.decoder-tests.js
util/certificates/der.decoder.pfx.root-tests.js
util/certificates/pkcs.filedecoder-tests.js
azure-tests.js
services/blob/blobservice-tests.js