@abtnode/router-provider 1.16.15-beta-12f50442 → 1.16.15-beta-d649cecc

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.
@@ -468,7 +468,6 @@ class NginxProvider extends BaseProvider {
468
468
  */
469
469
  _addBlockletTypeLocation({
470
470
  server,
471
- serverName,
472
471
  port,
473
472
  root,
474
473
  prefix,
@@ -490,7 +489,7 @@ class NginxProvider extends BaseProvider {
490
489
  const location = this._getLastLocation(server);
491
490
 
492
491
  // Note: 下面这段代码比较 tricky,不要在这段代码之前添加任何 add_header, proxy_set_header, proxy_hide_header 的语句,否则 nginx 配置可能无法按预期工作
493
- this._addCors({ location, corsAllowedOrigins, serverName });
492
+ this._addCors({ location, corsAllowedOrigins });
494
493
 
495
494
  this._addCommonResHeaders(location, commonHeaders);
496
495
  if (!cacheGroup && !suffix) {
@@ -558,12 +557,12 @@ class NginxProvider extends BaseProvider {
558
557
  location._add('proxy_pass', `http://${getUpstreamName(port)}`);
559
558
  }
560
559
 
561
- _addRedirectTypeLocation({ server, url, redirectCode, prefix, suffix, corsAllowedOrigins, serverName }) {
560
+ _addRedirectTypeLocation({ server, url, redirectCode, prefix, suffix, corsAllowedOrigins }) {
562
561
  const cleanUrl = trimEndSlash(url);
563
562
  server._add('location', `${concatPath(prefix, suffix)}`);
564
563
  const location = this._getLastLocation(server);
565
564
 
566
- this._addCors({ location, corsAllowedOrigins, serverName });
565
+ this._addCors({ location, corsAllowedOrigins });
567
566
 
568
567
  location._add('set $abt_query_string', '""');
569
568
  location._addVerbatimBlock('if ($query_string)', 'set $abt_query_string "?$query_string";');
@@ -581,10 +580,10 @@ class NginxProvider extends BaseProvider {
581
580
  }
582
581
  }
583
582
 
584
- _addRewriteTypeLocation({ server, url, prefix, suffix, corsAllowedOrigins, serverName }) {
583
+ _addRewriteTypeLocation({ server, url, prefix, suffix, corsAllowedOrigins }) {
585
584
  server._add('location', concatPath(prefix, suffix));
586
585
  const location = this._getLastLocation(server);
587
- this._addCors({ location, corsAllowedOrigins, serverName });
586
+ this._addCors({ location, corsAllowedOrigins });
588
587
  location._add('rewrite', `^${prefix}(.*) ${url}$1 last`);
589
588
  }
590
589
 
@@ -916,14 +915,14 @@ class NginxProvider extends BaseProvider {
916
915
  });
917
916
  }
918
917
 
919
- _addCors({ location, corsAllowedOrigins, serverName }) {
918
+ _addCors({ location, corsAllowedOrigins }) {
920
919
  if (!isEmpty(corsAllowedOrigins)) {
921
920
  if (corsAllowedOrigins.includes(DOMAIN_FOR_DEFAULT_SITE)) {
922
921
  location._add('include', 'includes/cors-loose');
923
922
  location._add('include', 'includes/security');
924
923
  } else {
925
924
  // TODO: @zhanghan 此处是否需要变更默认的值,如果在逻辑代码中有指定的 Access-Control-Allow-Origin,则应该优先遵守逻辑代码中的配置
926
- location._add('add_header', `Access-Control-Allow-Origin $allow_origin_${md5(serverName)} always`);
925
+ // location._add('add_header', `Access-Control-Allow-Origin $allow_origin_${md5(serverName)} always`); // TODO: zhenqiang 下面去掉了 OPTIONS 请求逻辑,这里也不应该处理 Access-Control-Allow-Origin
927
926
  location._add('include', 'includes/cors-strict');
928
927
  location._add('include', 'includes/security');
929
928
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abtnode/router-provider",
3
- "version": "1.16.15-beta-12f50442",
3
+ "version": "1.16.15-beta-d649cecc",
4
4
  "description": "Routing engine implementations for abt node",
5
5
  "author": "polunzh <polunzh@gmail.com>",
6
6
  "homepage": "https://github.com/ArcBlock/blocklet-server#readme",
@@ -32,10 +32,10 @@
32
32
  "url": "https://github.com/ArcBlock/blocklet-server/issues"
33
33
  },
34
34
  "dependencies": {
35
- "@abtnode/constant": "1.16.15-beta-12f50442",
36
- "@abtnode/logger": "1.16.15-beta-12f50442",
37
- "@abtnode/router-templates": "1.16.15-beta-12f50442",
38
- "@abtnode/util": "1.16.15-beta-12f50442",
35
+ "@abtnode/constant": "1.16.15-beta-d649cecc",
36
+ "@abtnode/logger": "1.16.15-beta-d649cecc",
37
+ "@abtnode/router-templates": "1.16.15-beta-d649cecc",
38
+ "@abtnode/util": "1.16.15-beta-d649cecc",
39
39
  "@arcblock/http-proxy": "^1.19.1",
40
40
  "axios": "^0.27.2",
41
41
  "debug": "^4.3.4",
@@ -59,5 +59,5 @@
59
59
  "bluebird": "^3.7.2",
60
60
  "fs-extra": "^10.1.0"
61
61
  },
62
- "gitHead": "48bda4b29eb31a70e0eb9cab0bce6e544960c7fd"
62
+ "gitHead": "56941d1056a9e5f189992ace6e93971aa4226d07"
63
63
  }