@maiyunnet/kebab 9.15.4 → 9.15.5
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 +36 -36
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/lib/undici.js +2 -0
- package/package.json +1 -1
package/doc/kebab-rag.md
CHANGED
|
@@ -1361,7 +1361,7 @@ index/variables/VER.md
|
|
|
1361
1361
|
|
|
1362
1362
|
# Variable: VER
|
|
1363
1363
|
|
|
1364
|
-
> `const` **VER**: `"9.15.
|
|
1364
|
+
> `const` **VER**: `"9.15.5"` = `'9.15.5'`
|
|
1365
1365
|
|
|
1366
1366
|
Defined in: [index.ts:10](https://github.com/maiyunnet/kebab/blob/master/index.ts#L10)
|
|
1367
1367
|
|
|
@@ -19072,7 +19072,7 @@ lib/undici/interfaces/IMproxyOptions.md
|
|
|
19072
19072
|
|
|
19073
19073
|
# Interface: IMproxyOptions
|
|
19074
19074
|
|
|
19075
|
-
Defined in: [lib/undici.ts:
|
|
19075
|
+
Defined in: [lib/undici.ts:820](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L820)
|
|
19076
19076
|
|
|
19077
19077
|
正向代理请求的传入参数选项
|
|
19078
19078
|
|
|
@@ -19082,7 +19082,7 @@ Defined in: [lib/undici.ts:818](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
19082
19082
|
|
|
19083
19083
|
> `optional` **filter?**: (`h`) => `boolean`
|
|
19084
19084
|
|
|
19085
|
-
Defined in: [lib/undici.ts:
|
|
19085
|
+
Defined in: [lib/undici.ts:829](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L829)
|
|
19086
19086
|
|
|
19087
19087
|
过滤 header,返回 true 则留下
|
|
19088
19088
|
|
|
@@ -19102,7 +19102,7 @@ Defined in: [lib/undici.ts:827](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
19102
19102
|
|
|
19103
19103
|
> `optional` **follow?**: `number`
|
|
19104
19104
|
|
|
19105
|
-
Defined in: [lib/undici.ts:
|
|
19105
|
+
Defined in: [lib/undici.ts:823](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L823)
|
|
19106
19106
|
|
|
19107
19107
|
***
|
|
19108
19108
|
|
|
@@ -19110,7 +19110,7 @@ Defined in: [lib/undici.ts:821](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
19110
19110
|
|
|
19111
19111
|
> `optional` **headers?**: [`THttpHeaders`](../type-aliases/THttpHeaders.md)
|
|
19112
19112
|
|
|
19113
|
-
Defined in: [lib/undici.ts:
|
|
19113
|
+
Defined in: [lib/undici.ts:827](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L827)
|
|
19114
19114
|
|
|
19115
19115
|
***
|
|
19116
19116
|
|
|
@@ -19118,7 +19118,7 @@ Defined in: [lib/undici.ts:825](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
19118
19118
|
|
|
19119
19119
|
> `optional` **hosts?**: `string` \| `Record`\<`string`, `string`\>
|
|
19120
19120
|
|
|
19121
|
-
Defined in: [lib/undici.ts:
|
|
19121
|
+
Defined in: [lib/undici.ts:825](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L825)
|
|
19122
19122
|
|
|
19123
19123
|
自定义 host 映射,如 {'www.maiyun.net': '127.0.0.1'},或全部映射到一个 host
|
|
19124
19124
|
|
|
@@ -19128,7 +19128,7 @@ Defined in: [lib/undici.ts:823](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
19128
19128
|
|
|
19129
19129
|
> `optional` **local?**: `string`
|
|
19130
19130
|
|
|
19131
|
-
Defined in: [lib/undici.ts:
|
|
19131
|
+
Defined in: [lib/undici.ts:826](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L826)
|
|
19132
19132
|
|
|
19133
19133
|
***
|
|
19134
19134
|
|
|
@@ -19136,7 +19136,7 @@ Defined in: [lib/undici.ts:824](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
19136
19136
|
|
|
19137
19137
|
> `optional` **reuse?**: `string` \| `Agent` \| `ProxyAgent`
|
|
19138
19138
|
|
|
19139
|
-
Defined in: [lib/undici.ts:
|
|
19139
|
+
Defined in: [lib/undici.ts:831](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L831)
|
|
19140
19140
|
|
|
19141
19141
|
默认为 default
|
|
19142
19142
|
|
|
@@ -19146,7 +19146,7 @@ Defined in: [lib/undici.ts:829](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
19146
19146
|
|
|
19147
19147
|
> `optional` **timeout?**: `number`
|
|
19148
19148
|
|
|
19149
|
-
Defined in: [lib/undici.ts:
|
|
19149
|
+
Defined in: [lib/undici.ts:822](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L822)
|
|
19150
19150
|
|
|
19151
19151
|
秒数,默认 300 秒
|
|
19152
19152
|
|
|
@@ -19161,7 +19161,7 @@ lib/undici/interfaces/IRequestOptions.md
|
|
|
19161
19161
|
|
|
19162
19162
|
# Interface: IRequestOptions
|
|
19163
19163
|
|
|
19164
|
-
Defined in: [lib/undici.ts:
|
|
19164
|
+
Defined in: [lib/undici.ts:787](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L787)
|
|
19165
19165
|
|
|
19166
19166
|
请求的传入参数选项
|
|
19167
19167
|
|
|
@@ -19171,7 +19171,7 @@ Defined in: [lib/undici.ts:785](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
19171
19171
|
|
|
19172
19172
|
> `optional` **cookie?**: `Record`\<`string`, [`ICookie`](../../cookie/interfaces/ICookie.md)\>
|
|
19173
19173
|
|
|
19174
|
-
Defined in: [lib/undici.ts:
|
|
19174
|
+
Defined in: [lib/undici.ts:812](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L812)
|
|
19175
19175
|
|
|
19176
19176
|
cookie 托管对象
|
|
19177
19177
|
|
|
@@ -19181,7 +19181,7 @@ cookie 托管对象
|
|
|
19181
19181
|
|
|
19182
19182
|
> `optional` **follow?**: `number`
|
|
19183
19183
|
|
|
19184
|
-
Defined in: [lib/undici.ts:
|
|
19184
|
+
Defined in: [lib/undici.ts:793](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L793)
|
|
19185
19185
|
|
|
19186
19186
|
追踪 location 次数,0 为不追踪,默认为 0
|
|
19187
19187
|
|
|
@@ -19191,7 +19191,7 @@ Defined in: [lib/undici.ts:791](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
19191
19191
|
|
|
19192
19192
|
> `optional` **headers?**: [`THttpHeaders`](../type-aliases/THttpHeaders.md)
|
|
19193
19193
|
|
|
19194
|
-
Defined in: [lib/undici.ts:
|
|
19194
|
+
Defined in: [lib/undici.ts:798](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L798)
|
|
19195
19195
|
|
|
19196
19196
|
***
|
|
19197
19197
|
|
|
@@ -19199,7 +19199,7 @@ Defined in: [lib/undici.ts:796](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
19199
19199
|
|
|
19200
19200
|
> `optional` **hosts?**: `string` \| `Record`\<`string`, `string`\>
|
|
19201
19201
|
|
|
19202
|
-
Defined in: [lib/undici.ts:
|
|
19202
|
+
Defined in: [lib/undici.ts:795](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L795)
|
|
19203
19203
|
|
|
19204
19204
|
自定义 host 映射,如 {'www.maiyun.net': '127.0.0.1'},或全部映射到一个 host
|
|
19205
19205
|
|
|
@@ -19209,7 +19209,7 @@ Defined in: [lib/undici.ts:793](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
19209
19209
|
|
|
19210
19210
|
> `optional` **keep?**: `boolean`
|
|
19211
19211
|
|
|
19212
|
-
Defined in: [lib/undici.ts:
|
|
19212
|
+
Defined in: [lib/undici.ts:808](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L808)
|
|
19213
19213
|
|
|
19214
19214
|
连接是否保持长连接(即是否允许复用),默认为 true
|
|
19215
19215
|
|
|
@@ -19219,7 +19219,7 @@ Defined in: [lib/undici.ts:806](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
19219
19219
|
|
|
19220
19220
|
> `optional` **local?**: `string`
|
|
19221
19221
|
|
|
19222
|
-
Defined in: [lib/undici.ts:
|
|
19222
|
+
Defined in: [lib/undici.ts:797](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L797)
|
|
19223
19223
|
|
|
19224
19224
|
***
|
|
19225
19225
|
|
|
@@ -19227,7 +19227,7 @@ Defined in: [lib/undici.ts:795](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
19227
19227
|
|
|
19228
19228
|
> `optional` **log?**: `boolean`
|
|
19229
19229
|
|
|
19230
|
-
Defined in: [lib/undici.ts:
|
|
19230
|
+
Defined in: [lib/undici.ts:814](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L814)
|
|
19231
19231
|
|
|
19232
19232
|
若有异常写入文件日志,默认为 true
|
|
19233
19233
|
|
|
@@ -19237,7 +19237,7 @@ Defined in: [lib/undici.ts:812](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
19237
19237
|
|
|
19238
19238
|
> `optional` **method?**: `"GET"` \| `"POST"` \| `"PUT"` \| `"DELETE"` \| `"OPTIONS"`
|
|
19239
19239
|
|
|
19240
|
-
Defined in: [lib/undici.ts:
|
|
19240
|
+
Defined in: [lib/undici.ts:788](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L788)
|
|
19241
19241
|
|
|
19242
19242
|
***
|
|
19243
19243
|
|
|
@@ -19245,7 +19245,7 @@ Defined in: [lib/undici.ts:786](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
19245
19245
|
|
|
19246
19246
|
> `optional` **mproxy?**: `object`
|
|
19247
19247
|
|
|
19248
|
-
Defined in: [lib/undici.ts:
|
|
19248
|
+
Defined in: [lib/undici.ts:800](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L800)
|
|
19249
19249
|
|
|
19250
19250
|
正向 mproxy 代理,url 如 https://xxx/abc
|
|
19251
19251
|
|
|
@@ -19273,7 +19273,7 @@ Defined in: [lib/undici.ts:798](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
19273
19273
|
|
|
19274
19274
|
> `optional` **reuse?**: `string` \| `Agent` \| `ProxyAgent`
|
|
19275
19275
|
|
|
19276
|
-
Defined in: [lib/undici.ts:
|
|
19276
|
+
Defined in: [lib/undici.ts:810](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L810)
|
|
19277
19277
|
|
|
19278
19278
|
复用池名/Agent,默认为 default
|
|
19279
19279
|
|
|
@@ -19283,7 +19283,7 @@ Defined in: [lib/undici.ts:808](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
19283
19283
|
|
|
19284
19284
|
> `optional` **save?**: `string`
|
|
19285
19285
|
|
|
19286
|
-
Defined in: [lib/undici.ts:
|
|
19286
|
+
Defined in: [lib/undici.ts:796](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L796)
|
|
19287
19287
|
|
|
19288
19288
|
***
|
|
19289
19289
|
|
|
@@ -19291,7 +19291,7 @@ Defined in: [lib/undici.ts:794](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
19291
19291
|
|
|
19292
19292
|
> `optional` **signal?**: `AbortSignal`
|
|
19293
19293
|
|
|
19294
|
-
Defined in: [lib/undici.ts:
|
|
19294
|
+
Defined in: [lib/undici.ts:816](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L816)
|
|
19295
19295
|
|
|
19296
19296
|
请求中止信号
|
|
19297
19297
|
|
|
@@ -19301,7 +19301,7 @@ Defined in: [lib/undici.ts:814](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
19301
19301
|
|
|
19302
19302
|
> `optional` **timeout?**: `number`
|
|
19303
19303
|
|
|
19304
|
-
Defined in: [lib/undici.ts:
|
|
19304
|
+
Defined in: [lib/undici.ts:791](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L791)
|
|
19305
19305
|
|
|
19306
19306
|
秒数,默认 300 秒
|
|
19307
19307
|
|
|
@@ -19311,7 +19311,7 @@ Defined in: [lib/undici.ts:789](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
19311
19311
|
|
|
19312
19312
|
> `optional` **type?**: `"form"` \| `"json"`
|
|
19313
19313
|
|
|
19314
|
-
Defined in: [lib/undici.ts:
|
|
19314
|
+
Defined in: [lib/undici.ts:789](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L789)
|
|
19315
19315
|
|
|
19316
19316
|
lib/undici/interfaces/IRproxyOptions.md
|
|
19317
19317
|
---
|
|
@@ -19324,7 +19324,7 @@ lib/undici/interfaces/IRproxyOptions.md
|
|
|
19324
19324
|
|
|
19325
19325
|
# Interface: IRproxyOptions
|
|
19326
19326
|
|
|
19327
|
-
Defined in: [lib/undici.ts:
|
|
19327
|
+
Defined in: [lib/undici.ts:835](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L835)
|
|
19328
19328
|
|
|
19329
19329
|
反向代理请求的传入参数选项
|
|
19330
19330
|
|
|
@@ -19334,7 +19334,7 @@ Defined in: [lib/undici.ts:833](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
19334
19334
|
|
|
19335
19335
|
> `optional` **body?**: `string` \| `Buffer`\<`ArrayBufferLike`\> \| `Readable`
|
|
19336
19336
|
|
|
19337
|
-
Defined in: [lib/undici.ts:
|
|
19337
|
+
Defined in: [lib/undici.ts:854](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L854)
|
|
19338
19338
|
|
|
19339
19339
|
手动传入请求体(优先于原始 req 流),用于 req 流已消费后仍需转发 body 的场景
|
|
19340
19340
|
|
|
@@ -19344,7 +19344,7 @@ Defined in: [lib/undici.ts:852](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
19344
19344
|
|
|
19345
19345
|
> `optional` **filter?**: (`h`) => `boolean`
|
|
19346
19346
|
|
|
19347
|
-
Defined in: [lib/undici.ts:
|
|
19347
|
+
Defined in: [lib/undici.ts:844](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L844)
|
|
19348
19348
|
|
|
19349
19349
|
过滤 header,返回 true 则留下
|
|
19350
19350
|
|
|
@@ -19364,7 +19364,7 @@ Defined in: [lib/undici.ts:842](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
19364
19364
|
|
|
19365
19365
|
> `optional` **follow?**: `number`
|
|
19366
19366
|
|
|
19367
|
-
Defined in: [lib/undici.ts:
|
|
19367
|
+
Defined in: [lib/undici.ts:838](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L838)
|
|
19368
19368
|
|
|
19369
19369
|
***
|
|
19370
19370
|
|
|
@@ -19372,7 +19372,7 @@ Defined in: [lib/undici.ts:836](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
19372
19372
|
|
|
19373
19373
|
> `optional` **headers?**: [`THttpHeaders`](../type-aliases/THttpHeaders.md)
|
|
19374
19374
|
|
|
19375
|
-
Defined in: [lib/undici.ts:
|
|
19375
|
+
Defined in: [lib/undici.ts:842](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L842)
|
|
19376
19376
|
|
|
19377
19377
|
***
|
|
19378
19378
|
|
|
@@ -19380,7 +19380,7 @@ Defined in: [lib/undici.ts:840](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
19380
19380
|
|
|
19381
19381
|
> `optional` **hosts?**: `string` \| `Record`\<`string`, `string`\>
|
|
19382
19382
|
|
|
19383
|
-
Defined in: [lib/undici.ts:
|
|
19383
|
+
Defined in: [lib/undici.ts:840](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L840)
|
|
19384
19384
|
|
|
19385
19385
|
自定义 host 映射,如 {'www.maiyun.net': '127.0.0.1'},或全部映射到一个 host
|
|
19386
19386
|
|
|
@@ -19390,7 +19390,7 @@ Defined in: [lib/undici.ts:838](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
19390
19390
|
|
|
19391
19391
|
> `optional` **local?**: `string`
|
|
19392
19392
|
|
|
19393
|
-
Defined in: [lib/undici.ts:
|
|
19393
|
+
Defined in: [lib/undici.ts:841](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L841)
|
|
19394
19394
|
|
|
19395
19395
|
***
|
|
19396
19396
|
|
|
@@ -19398,7 +19398,7 @@ Defined in: [lib/undici.ts:839](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
19398
19398
|
|
|
19399
19399
|
> `optional` **mproxy?**: `object`
|
|
19400
19400
|
|
|
19401
|
-
Defined in: [lib/undici.ts:
|
|
19401
|
+
Defined in: [lib/undici.ts:846](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L846)
|
|
19402
19402
|
|
|
19403
19403
|
正向 mproxy 代理,url 如 https://xxx/abc
|
|
19404
19404
|
|
|
@@ -19426,7 +19426,7 @@ Defined in: [lib/undici.ts:844](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
19426
19426
|
|
|
19427
19427
|
> `optional` **querys?**: `Record`\<`string`, `any`\>
|
|
19428
19428
|
|
|
19429
|
-
Defined in: [lib/undici.ts:
|
|
19429
|
+
Defined in: [lib/undici.ts:856](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L856)
|
|
19430
19430
|
|
|
19431
19431
|
自定义 GET 查询参数,传入后直接替换代理目标 URL 的整个 query string
|
|
19432
19432
|
|
|
@@ -19436,7 +19436,7 @@ Defined in: [lib/undici.ts:854](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
19436
19436
|
|
|
19437
19437
|
> `optional` **reuse?**: `string` \| `Agent` \| `ProxyAgent`
|
|
19438
19438
|
|
|
19439
|
-
Defined in: [lib/undici.ts:
|
|
19439
|
+
Defined in: [lib/undici.ts:858](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L858)
|
|
19440
19440
|
|
|
19441
19441
|
默认为 default
|
|
19442
19442
|
|
|
@@ -19446,7 +19446,7 @@ Defined in: [lib/undici.ts:856](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
19446
19446
|
|
|
19447
19447
|
> `optional` **timeout?**: `number`
|
|
19448
19448
|
|
|
19449
|
-
Defined in: [lib/undici.ts:
|
|
19449
|
+
Defined in: [lib/undici.ts:837](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L837)
|
|
19450
19450
|
|
|
19451
19451
|
秒数,默认 300 秒
|
|
19452
19452
|
|
|
@@ -19935,7 +19935,7 @@ lib/undici/type-aliases/THttpHeaders.md
|
|
|
19935
19935
|
|
|
19936
19936
|
> **THttpHeaders** = `http.IncomingHttpHeaders` & `object`
|
|
19937
19937
|
|
|
19938
|
-
Defined in: [lib/undici.ts:
|
|
19938
|
+
Defined in: [lib/undici.ts:863](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L863)
|
|
19939
19939
|
|
|
19940
19940
|
http headers
|
|
19941
19941
|
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* --- 本文件用来定义每个目录实体地址的常量 ---
|
|
7
7
|
*/
|
|
8
8
|
/** --- 当前系统版本号 --- */
|
|
9
|
-
export const VER = '9.15.
|
|
9
|
+
export const VER = '9.15.5';
|
|
10
10
|
// --- 服务端用的路径 ---
|
|
11
11
|
const imu = decodeURIComponent(import.meta.url).replace('file://', '').replace(/^\/(\w:)/, '$1');
|
|
12
12
|
/** --- /xxx/xxx --- */
|
package/lib/undici.js
CHANGED
|
@@ -677,6 +677,8 @@ export async function rproxy(ctr, route, opt = {}) {
|
|
|
677
677
|
const compress = upstreamEncoded ? null : lZlib.createCompress(req.headers['accept-encoding'] ?? '');
|
|
678
678
|
if (compress) {
|
|
679
679
|
res.setHeader('content-encoding', compress.type);
|
|
680
|
+
// --- 本层压缩后响应大小会变化,不能沿用上游的 content-length ---
|
|
681
|
+
res.removeHeader('content-length');
|
|
680
682
|
}
|
|
681
683
|
lCore.writeHead(res, rres.headers?.['http-code'] ?? 200);
|
|
682
684
|
await new Promise((resolve) => {
|