efront 3.20.11 → 3.20.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/coms/basic/cross_.js +7 -2
- package/package.json +1 -1
- package/public/efront.js +1 -1
package/coms/basic/cross_.js
CHANGED
|
@@ -29,7 +29,12 @@ function isChildPath(relative, path) {
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
var getCrossUrl = function (domain, headers, encrypt) {
|
|
32
|
-
if (notCross(domain,
|
|
32
|
+
if (notCross(domain, encrypt)) return domain;
|
|
33
|
+
var basehost = parseURL(base).host || parseURL(location_href).host;
|
|
34
|
+
if (parseURL(domain).host === basehost) {
|
|
35
|
+
if (!encrypt) return domain;
|
|
36
|
+
domain = domain.replace(domainReg, "/$3$4");
|
|
37
|
+
}
|
|
33
38
|
var originDomain = getDomainPath(domain);
|
|
34
39
|
var _cookies = getCookies(originDomain);
|
|
35
40
|
var _headers = {};
|
|
@@ -334,7 +339,7 @@ function addDirect(a) {
|
|
|
334
339
|
function notCross(domain, encrypt) {
|
|
335
340
|
if (!location_href || !base || !/^https?\:\/\/|^s?\/\//.test(domain)) return true;
|
|
336
341
|
if (location_href === domain.slice(0, location_href.length) ||
|
|
337
|
-
domain.replace(domainReg, '$2') === base.replace(domainReg, '$2')) return !encrypt;
|
|
342
|
+
domain.replace(domainReg, '$2') === base.replace(domainReg, '$2') || /^\/[^\/]/.test(domain)) return !encrypt;
|
|
338
343
|
for (var cx = 0, dx = cors_hosts.length; cx < dx; cx++) {
|
|
339
344
|
var host = cors_hosts[cx];
|
|
340
345
|
if (host instanceof RegExp) {
|