|
|
@@ -16,12 +16,19 @@ Ext.define('saas.override.data.Connection', {
|
|
|
},
|
|
|
|
|
|
privates: {
|
|
|
+ parseBasePath: function(basePath) {
|
|
|
+ if (Ext.isObject(basePath)) {
|
|
|
+ return basePath[window.location.protocol.split(":")[0]];
|
|
|
+ }
|
|
|
+ return basePath;
|
|
|
+ },
|
|
|
setupServerOptions: function(options) {
|
|
|
var serverOptions = Ext.manifest.server, originUrl = options.url;
|
|
|
if (serverOptions && serverOptions.basePath && !this.urlRegexp.test(originUrl) &&
|
|
|
(!serverOptions.urlPattern || new RegExp(serverOptions.urlPattern).test(originUrl))) {
|
|
|
Ext.Object.merge(options, {
|
|
|
- url: serverOptions.basePath + (originUrl.indexOf('/') == 0 ? '' : '/') + originUrl,
|
|
|
+ url: this.parseBasePath(serverOptions.basePath)
|
|
|
+ + (originUrl.indexOf('/') == 0 ? '' : '/') + originUrl,
|
|
|
headers: this.getDefaultServerHeaders() || {}
|
|
|
});
|
|
|
}
|