badmfck-api-server 4.0.51 → 4.0.61

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.
@@ -95,7 +95,7 @@ async function Initializer(services) {
95
95
  }
96
96
  exports.Initializer = Initializer;
97
97
  class APIService extends BaseService_1.BaseService {
98
- version = "4.0.5";
98
+ version = "4.0.6";
99
99
  options;
100
100
  monitor = null;
101
101
  started = new Date();
@@ -234,6 +234,8 @@ class APIService extends BaseService_1.BaseService {
234
234
  const originHeader = req.headers.origin;
235
235
  if (!originHeader)
236
236
  return next();
237
+ if (this.options.corsHostWhiteList && this.options.corsHostWhiteList.find(x => x === "*"))
238
+ return next();
237
239
  let originNorm;
238
240
  try {
239
241
  originNorm = new URL(String(originHeader)).origin.replace(/\/$/, "");
@@ -75,6 +75,7 @@ class Validator {
75
75
  optional: s_options.optional === undefined ? structure[k + 'optional'] ?? false : s_options.optional,
76
76
  default: s_options.default === undefined ? structure[k + 'default'] ?? undefined : s_options.default,
77
77
  regex: s_options.regex === undefined ? structure[k + 'regex'] ?? undefined : s_options.regex,
78
+ details: s_options.details === undefined ? structure[k + 'details'] ?? undefined : s_options.details,
78
79
  };
79
80
  }
80
81
  static async validateStructure(structure, object, level = 0, parentPath = "") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "badmfck-api-server",
3
- "version": "4.0.51",
3
+ "version": "4.0.61",
4
4
  "description": "Simple API http server based on express",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",