@maiyunnet/kebab 3.1.12 → 3.1.14

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/index.d.ts CHANGED
@@ -8,7 +8,7 @@
8
8
  * ------------------------
9
9
  */
10
10
  /** --- 当前系统版本号 --- */
11
- export declare const VER = "3.1.12";
11
+ export declare const VER = "3.1.14";
12
12
  /** --- 框架根目录,以 / 结尾 --- */
13
13
  export declare const ROOT_PATH: string;
14
14
  export declare const LIB_PATH: string;
package/index.js CHANGED
@@ -9,7 +9,7 @@
9
9
  * ------------------------
10
10
  */
11
11
  /** --- 当前系统版本号 --- */
12
- export const VER = '3.1.12';
12
+ export const VER = '3.1.14';
13
13
  // --- 服务端用的路径 ---
14
14
  const imu = decodeURIComponent(import.meta.url).replace('file://', '').replace(/^\/(\w:)/, '$1');
15
15
  /** --- /xxx/xxx --- */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maiyunnet/kebab",
3
- "version": "3.1.12",
3
+ "version": "3.1.14",
4
4
  "description": "Simple, easy-to-use, and fully-featured Node.js framework that is ready-to-use out of the box.",
5
5
  "type": "module",
6
6
  "keywords": [
package/sys/child.js CHANGED
@@ -586,7 +586,7 @@ function getVhostByHostname(hostname) {
586
586
  }
587
587
  else if (domain.includes('*')) {
588
588
  // --- 通配符匹配 ---
589
- domain = domain.replace(/\*/, '.+?').replace(/\./, '\\.');
589
+ domain = domain.replace(/\./g, '\\.').replace(/\*/, '.+?');
590
590
  if (new RegExp(`^${domain}$`).test(hostname)) {
591
591
  vSub = vhost;
592
592
  }
package/sys/route.js CHANGED
@@ -223,7 +223,7 @@ export async function run(data) {
223
223
  let rtn;
224
224
  if (data.socket && data.req instanceof http.IncomingMessage) {
225
225
  // --- socket 模式,判断真实控制器文件是否存在 ---
226
- const filePath = config.const.wsPath + (pathLeft || 'root') + '.js';
226
+ const filePath = config.const.wsPath + pathLeft + '.js';
227
227
  if (!await lFs.isFile(filePath)) {
228
228
  // --- 指定的控制器不存在 ---
229
229
  data.socket?.destroy();