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.
@@ -29,7 +29,12 @@ function isChildPath(relative, path) {
29
29
  }
30
30
 
31
31
  var getCrossUrl = function (domain, headers, encrypt) {
32
- if (notCross(domain, !!encrypt)) return 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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "efront",
3
- "version": "3.20.11",
3
+ "version": "3.20.13",
4
4
  "description": "一个开发工具,开放源代码,自带组件库和编译环境,可以用来开发web组件,web应用或nodejs模块,或做为已有代码的加密工具,也可以做为静态页面服务器或跨域中转服务器使用",
5
5
  "main": "public/efront.js",
6
6
  "directories": {