@nocobase/server 2.1.29 → 2.1.30

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/lib/helper.d.ts CHANGED
@@ -11,6 +11,7 @@ import { Command } from 'commander';
11
11
  import Application, { ApplicationOptions } from './application';
12
12
  export declare function createI18n(options: ApplicationOptions): import("i18next").i18n;
13
13
  export declare function createResourcer(options: ApplicationOptions): Resourcer;
14
+ export declare function resolveCorsOrigin(ctx: any): any;
14
15
  export declare function registerMiddlewares(app: Application, options: ApplicationOptions): void;
15
16
  export declare const createAppProxy: (app: Application) => Application<import("./application").DefaultState, import("./application").DefaultContext>;
16
17
  export declare const getCommandFullName: (command: Command) => string;
package/lib/helper.js CHANGED
@@ -45,6 +45,7 @@ __export(helper_exports, {
45
45
  getBodyLimit: () => getBodyLimit,
46
46
  getCommandFullName: () => getCommandFullName,
47
47
  registerMiddlewares: () => registerMiddlewares,
48
+ resolveCorsOrigin: () => resolveCorsOrigin,
48
49
  tsxRerunning: () => tsxRerunning
49
50
  });
50
51
  module.exports = __toCommonJS(helper_exports);
@@ -89,7 +90,7 @@ function resolveCorsOrigin(ctx) {
89
90
  const whitelist = new Set(
90
91
  whitelistString.split(",").map((item) => item.trim()).filter(Boolean)
91
92
  );
92
- if (whitelist.has(origin)) {
93
+ if (whitelist.has("*") || whitelist.has(origin)) {
93
94
  return origin;
94
95
  }
95
96
  return false;
@@ -309,5 +310,6 @@ __name(createContextVariablesScope, "createContextVariablesScope");
309
310
  getBodyLimit,
310
311
  getCommandFullName,
311
312
  registerMiddlewares,
313
+ resolveCorsOrigin,
312
314
  tsxRerunning
313
315
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/server",
3
- "version": "2.1.29",
3
+ "version": "2.1.30",
4
4
  "main": "lib/index.js",
5
5
  "types": "./lib/index.d.ts",
6
6
  "license": "Apache-2.0",
@@ -10,21 +10,21 @@
10
10
  "@koa/cors": "^5.0.0",
11
11
  "@koa/multer": "^3.1.0",
12
12
  "@koa/router": "^13.1.0",
13
- "@nocobase/acl": "2.1.29",
14
- "@nocobase/actions": "2.1.29",
15
- "@nocobase/ai": "2.1.29",
16
- "@nocobase/auth": "2.1.29",
17
- "@nocobase/cache": "2.1.29",
18
- "@nocobase/data-source-manager": "2.1.29",
19
- "@nocobase/database": "2.1.29",
20
- "@nocobase/evaluators": "2.1.29",
21
- "@nocobase/lock-manager": "2.1.29",
22
- "@nocobase/logger": "2.1.29",
23
- "@nocobase/resourcer": "2.1.29",
24
- "@nocobase/sdk": "2.1.29",
25
- "@nocobase/snowflake-id": "2.1.29",
26
- "@nocobase/telemetry": "2.1.29",
27
- "@nocobase/utils": "2.1.29",
13
+ "@nocobase/acl": "2.1.30",
14
+ "@nocobase/actions": "2.1.30",
15
+ "@nocobase/ai": "2.1.30",
16
+ "@nocobase/auth": "2.1.30",
17
+ "@nocobase/cache": "2.1.30",
18
+ "@nocobase/data-source-manager": "2.1.30",
19
+ "@nocobase/database": "2.1.30",
20
+ "@nocobase/evaluators": "2.1.30",
21
+ "@nocobase/lock-manager": "2.1.30",
22
+ "@nocobase/logger": "2.1.30",
23
+ "@nocobase/resourcer": "2.1.30",
24
+ "@nocobase/sdk": "2.1.30",
25
+ "@nocobase/snowflake-id": "2.1.30",
26
+ "@nocobase/telemetry": "2.1.30",
27
+ "@nocobase/utils": "2.1.30",
28
28
  "@types/decompress": "4.2.7",
29
29
  "@types/ini": "^1.3.31",
30
30
  "@types/koa-send": "^4.1.3",
@@ -61,5 +61,5 @@
61
61
  "@types/serve-handler": "^6.1.1",
62
62
  "@types/ws": "^8.5.5"
63
63
  },
64
- "gitHead": "d9848c5df07cef806cb938bb14b3f4ef5f3d0129"
64
+ "gitHead": "c1a4bff0fd3c8b30e06fc6f50ad33e054b04061a"
65
65
  }