@maiyunnet/kebab 5.0.1 → 5.0.2
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 +1 -1
- package/index.js +1 -1
- package/lib/db/conn.js +2 -2
- package/lib/db/pool.js +1 -1
- package/package.json +1 -1
- package/sys/child.js +5 -4
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* --- 本文件用来定义每个目录实体地址的常量 ---
|
|
7
7
|
*/
|
|
8
8
|
/** --- 当前系统版本号 --- */
|
|
9
|
-
export const VER = '5.0.
|
|
9
|
+
export const VER = '5.0.2';
|
|
10
10
|
// --- 服务端用的路径 ---
|
|
11
11
|
const imu = decodeURIComponent(import.meta.url).replace('file://', '').replace(/^\/(\w:)/, '$1');
|
|
12
12
|
/** --- /xxx/xxx --- */
|
package/lib/db/conn.js
CHANGED
|
@@ -174,7 +174,7 @@ export class Connection {
|
|
|
174
174
|
catch (e) {
|
|
175
175
|
rtn.error = {
|
|
176
176
|
'message': e.message,
|
|
177
|
-
'errno': e.errno ?? Number(e.code),
|
|
177
|
+
'errno': e.errno ?? Number(e.code.replace(/[a-zA-Z]/g, '')),
|
|
178
178
|
};
|
|
179
179
|
rtn.result = -500;
|
|
180
180
|
}
|
|
@@ -241,7 +241,7 @@ export class Connection {
|
|
|
241
241
|
}
|
|
242
242
|
}
|
|
243
243
|
catch (e) {
|
|
244
|
-
let errno = e.errno ?? Number(e.code.replace(/[a-
|
|
244
|
+
let errno = e.errno ?? Number(e.code.replace(/[a-zA-Z]/g, ''));
|
|
245
245
|
if (errno === 23505) {
|
|
246
246
|
errno = 1062;
|
|
247
247
|
}
|
package/lib/db/pool.js
CHANGED
|
@@ -217,7 +217,7 @@ export class Pool {
|
|
|
217
217
|
c.using();
|
|
218
218
|
link.on('error', function (err) {
|
|
219
219
|
c.setLost();
|
|
220
|
-
if (err.code !== 'PROTOCOL_CONNECTION_LOST') {
|
|
220
|
+
if (err.code !== 'PROTOCOL_CONNECTION_LOST' && err.code !== 'ECONNRESET') {
|
|
221
221
|
lCore.debug('[DB][_getConnection][MYSQL][error]', err);
|
|
222
222
|
lCore.log({}, '[DB][_getConnection][MYSQL][error] ' + err.message, '-error');
|
|
223
223
|
}
|
package/package.json
CHANGED
package/sys/child.js
CHANGED
|
@@ -227,11 +227,12 @@ async function requestHandler(req, res, https) {
|
|
|
227
227
|
let host = req.headers[':authority'];
|
|
228
228
|
if (host === undefined || typeof host !== 'string') {
|
|
229
229
|
host = req.headers['host'];
|
|
230
|
-
if (host === undefined) {
|
|
231
|
-
res.end();
|
|
232
|
-
return;
|
|
233
|
-
}
|
|
234
230
|
}
|
|
231
|
+
if (host === undefined) {
|
|
232
|
+
res.end();
|
|
233
|
+
return;
|
|
234
|
+
}
|
|
235
|
+
host = host.split(':')[0] + ':' + (req.socket.localPort ?? (https ? '443' : '80'));
|
|
235
236
|
const uri = lText.parseUrl(`http${https ? 's' : ''}://${host}${req.url ?? ''}`);
|
|
236
237
|
/** --- 当前的 vhost 配置文件 --- */
|
|
237
238
|
const vhost = await getVhostByHostname(uri.hostname ?? '');
|