@maiyunnet/kebab 8.5.1 → 8.5.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/doc/kebab-rag.md +1 -1
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/package.json +1 -1
- package/sys/child.js +11 -10
package/doc/kebab-rag.md
CHANGED
|
@@ -1410,7 +1410,7 @@ index/variables/VER.md
|
|
|
1410
1410
|
|
|
1411
1411
|
# Variable: VER
|
|
1412
1412
|
|
|
1413
|
-
> `const` **VER**: `"8.5.
|
|
1413
|
+
> `const` **VER**: `"8.5.2"` = `'8.5.2'`
|
|
1414
1414
|
|
|
1415
1415
|
Defined in: [index.ts:10](https://github.com/maiyunnet/kebab/blob/master/index.ts#L10)
|
|
1416
1416
|
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* --- 本文件用来定义每个目录实体地址的常量 ---
|
|
7
7
|
*/
|
|
8
8
|
/** --- 当前系统版本号 --- */
|
|
9
|
-
export const VER = '8.5.
|
|
9
|
+
export const VER = '8.5.2';
|
|
10
10
|
// --- 服务端用的路径 ---
|
|
11
11
|
const imu = decodeURIComponent(import.meta.url).replace('file://', '').replace(/^\/(\w:)/, '$1');
|
|
12
12
|
/** --- /xxx/xxx --- */
|
package/package.json
CHANGED
package/sys/child.js
CHANGED
|
@@ -118,9 +118,8 @@ async function run() {
|
|
|
118
118
|
const host = (req.headers[':authority'] ?? req.headers['host'] ?? '');
|
|
119
119
|
if (!host) {
|
|
120
120
|
lCore.writeHead(res, 403);
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
});
|
|
121
|
+
// --- 不能用 req.socket.destroy() 可能会导致底层复用(如 CDN) 的连接被直接断开 ---
|
|
122
|
+
res.end('403 Forbidden');
|
|
124
123
|
return;
|
|
125
124
|
}
|
|
126
125
|
wrapWithLinkCount(host + req.url, () => requestHandler(req, res, true), '[CHILD][http2][request]', req.method ?? 'GET');
|
|
@@ -139,14 +138,17 @@ async function run() {
|
|
|
139
138
|
if (!host) {
|
|
140
139
|
res.setHeader('x-kebab-error', '0');
|
|
141
140
|
lCore.writeHead(res, 403);
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
});
|
|
141
|
+
// --- 不能用 req.socket.destroy() 可能会导致底层复用(如 CDN) 的连接被直接断开 ---
|
|
142
|
+
res.end('403 Forbidden');
|
|
145
143
|
return;
|
|
146
144
|
}
|
|
147
145
|
wrapWithLinkCount(host + (req.url ?? ''), () => requestHandler(req, res, false), '[CHILD][http][request]', req.method ?? 'GET');
|
|
148
146
|
}).on('clientError', (err, socket) => {
|
|
149
|
-
socket.destroy()
|
|
147
|
+
// --- 不能用 socket.destroy() 可能会导致底层复用(如 CDN) 的连接被直接断开 ---
|
|
148
|
+
if (err.code === 'ECONNRESET' || !socket.writable) {
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
socket.end('HTTP/1.1 400 Bad Request\r\n\r\n');
|
|
150
152
|
}).on('upgrade', function (req, socket, head) {
|
|
151
153
|
const host = (req.headers['host'] ?? '');
|
|
152
154
|
if (!host) {
|
|
@@ -210,9 +212,8 @@ async function requestHandler(req, res, https) {
|
|
|
210
212
|
if (!vhost) {
|
|
211
213
|
res.setHeader('x-kebab-error', '1');
|
|
212
214
|
lCore.writeHead(res, 403);
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
});
|
|
215
|
+
// --- 不能用 req.socket.destroy() 可能会导致底层复用(如 CDN) 的连接被直接断开 ---
|
|
216
|
+
res.end('403 Forbidden');
|
|
216
217
|
return;
|
|
217
218
|
/*
|
|
218
219
|
const text = '<h1>Kebab: No permissions</h1>host: ' + (req.headers[':authority'] as string | undefined ?? req.headers['host'] ?? '') + '<br>url: ' + (lText.htmlescape(req.url ?? ''));
|