@maiyunnet/kebab 9.11.7 → 9.11.8
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 +54 -34
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/lib/undici.d.ts +4 -0
- package/lib/undici.js +23 -1
- package/package.json +1 -1
package/doc/kebab-rag.md
CHANGED
|
@@ -1360,7 +1360,7 @@ index/variables/VER.md
|
|
|
1360
1360
|
|
|
1361
1361
|
# Variable: VER
|
|
1362
1362
|
|
|
1363
|
-
> `const` **VER**: `"9.11.
|
|
1363
|
+
> `const` **VER**: `"9.11.8"` = `'9.11.8'`
|
|
1364
1364
|
|
|
1365
1365
|
Defined in: [index.ts:10](https://github.com/maiyunnet/kebab/blob/master/index.ts#L10)
|
|
1366
1366
|
|
|
@@ -18601,7 +18601,7 @@ lib/undici/interfaces/IMproxyOptions.md
|
|
|
18601
18601
|
|
|
18602
18602
|
# Interface: IMproxyOptions
|
|
18603
18603
|
|
|
18604
|
-
Defined in: [lib/undici.ts:
|
|
18604
|
+
Defined in: [lib/undici.ts:745](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L745)
|
|
18605
18605
|
|
|
18606
18606
|
正向代理请求的传入参数选项
|
|
18607
18607
|
|
|
@@ -18611,7 +18611,7 @@ Defined in: [lib/undici.ts:723](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
18611
18611
|
|
|
18612
18612
|
> `optional` **filter?**: (`h`) => `boolean`
|
|
18613
18613
|
|
|
18614
|
-
Defined in: [lib/undici.ts:
|
|
18614
|
+
Defined in: [lib/undici.ts:754](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L754)
|
|
18615
18615
|
|
|
18616
18616
|
过滤 header,返回 true 则留下
|
|
18617
18617
|
|
|
@@ -18631,7 +18631,7 @@ Defined in: [lib/undici.ts:732](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
18631
18631
|
|
|
18632
18632
|
> `optional` **follow?**: `number`
|
|
18633
18633
|
|
|
18634
|
-
Defined in: [lib/undici.ts:
|
|
18634
|
+
Defined in: [lib/undici.ts:748](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L748)
|
|
18635
18635
|
|
|
18636
18636
|
***
|
|
18637
18637
|
|
|
@@ -18639,7 +18639,7 @@ Defined in: [lib/undici.ts:726](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
18639
18639
|
|
|
18640
18640
|
> `optional` **headers?**: [`THttpHeaders`](../type-aliases/THttpHeaders.md)
|
|
18641
18641
|
|
|
18642
|
-
Defined in: [lib/undici.ts:
|
|
18642
|
+
Defined in: [lib/undici.ts:752](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L752)
|
|
18643
18643
|
|
|
18644
18644
|
***
|
|
18645
18645
|
|
|
@@ -18647,7 +18647,7 @@ Defined in: [lib/undici.ts:730](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
18647
18647
|
|
|
18648
18648
|
> `optional` **hosts?**: `string` \| `Record`\<`string`, `string`\>
|
|
18649
18649
|
|
|
18650
|
-
Defined in: [lib/undici.ts:
|
|
18650
|
+
Defined in: [lib/undici.ts:750](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L750)
|
|
18651
18651
|
|
|
18652
18652
|
自定义 host 映射,如 {'www.maiyun.net': '127.0.0.1'},或全部映射到一个 host
|
|
18653
18653
|
|
|
@@ -18657,7 +18657,7 @@ Defined in: [lib/undici.ts:728](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
18657
18657
|
|
|
18658
18658
|
> `optional` **local?**: `string`
|
|
18659
18659
|
|
|
18660
|
-
Defined in: [lib/undici.ts:
|
|
18660
|
+
Defined in: [lib/undici.ts:751](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L751)
|
|
18661
18661
|
|
|
18662
18662
|
***
|
|
18663
18663
|
|
|
@@ -18665,7 +18665,7 @@ Defined in: [lib/undici.ts:729](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
18665
18665
|
|
|
18666
18666
|
> `optional` **reuse?**: `string` \| `Agent` \| `ProxyAgent`
|
|
18667
18667
|
|
|
18668
|
-
Defined in: [lib/undici.ts:
|
|
18668
|
+
Defined in: [lib/undici.ts:756](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L756)
|
|
18669
18669
|
|
|
18670
18670
|
默认为 default
|
|
18671
18671
|
|
|
@@ -18675,7 +18675,7 @@ Defined in: [lib/undici.ts:734](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
18675
18675
|
|
|
18676
18676
|
> `optional` **timeout?**: `number`
|
|
18677
18677
|
|
|
18678
|
-
Defined in: [lib/undici.ts:
|
|
18678
|
+
Defined in: [lib/undici.ts:747](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L747)
|
|
18679
18679
|
|
|
18680
18680
|
秒数,默认 300 秒
|
|
18681
18681
|
|
|
@@ -18690,7 +18690,7 @@ lib/undici/interfaces/IRequestOptions.md
|
|
|
18690
18690
|
|
|
18691
18691
|
# Interface: IRequestOptions
|
|
18692
18692
|
|
|
18693
|
-
Defined in: [lib/undici.ts:
|
|
18693
|
+
Defined in: [lib/undici.ts:712](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L712)
|
|
18694
18694
|
|
|
18695
18695
|
请求的传入参数选项
|
|
18696
18696
|
|
|
@@ -18700,7 +18700,7 @@ Defined in: [lib/undici.ts:690](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
18700
18700
|
|
|
18701
18701
|
> `optional` **cookie?**: `Record`\<`string`, [`ICookie`](../../cookie/interfaces/ICookie.md)\>
|
|
18702
18702
|
|
|
18703
|
-
Defined in: [lib/undici.ts:
|
|
18703
|
+
Defined in: [lib/undici.ts:737](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L737)
|
|
18704
18704
|
|
|
18705
18705
|
cookie 托管对象
|
|
18706
18706
|
|
|
@@ -18710,7 +18710,7 @@ cookie 托管对象
|
|
|
18710
18710
|
|
|
18711
18711
|
> `optional` **follow?**: `number`
|
|
18712
18712
|
|
|
18713
|
-
Defined in: [lib/undici.ts:
|
|
18713
|
+
Defined in: [lib/undici.ts:718](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L718)
|
|
18714
18714
|
|
|
18715
18715
|
追踪 location 次数,0 为不追踪,默认为 0
|
|
18716
18716
|
|
|
@@ -18720,7 +18720,7 @@ Defined in: [lib/undici.ts:696](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
18720
18720
|
|
|
18721
18721
|
> `optional` **headers?**: [`THttpHeaders`](../type-aliases/THttpHeaders.md)
|
|
18722
18722
|
|
|
18723
|
-
Defined in: [lib/undici.ts:
|
|
18723
|
+
Defined in: [lib/undici.ts:723](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L723)
|
|
18724
18724
|
|
|
18725
18725
|
***
|
|
18726
18726
|
|
|
@@ -18728,7 +18728,7 @@ Defined in: [lib/undici.ts:701](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
18728
18728
|
|
|
18729
18729
|
> `optional` **hosts?**: `string` \| `Record`\<`string`, `string`\>
|
|
18730
18730
|
|
|
18731
|
-
Defined in: [lib/undici.ts:
|
|
18731
|
+
Defined in: [lib/undici.ts:720](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L720)
|
|
18732
18732
|
|
|
18733
18733
|
自定义 host 映射,如 {'www.maiyun.net': '127.0.0.1'},或全部映射到一个 host
|
|
18734
18734
|
|
|
@@ -18738,7 +18738,7 @@ Defined in: [lib/undici.ts:698](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
18738
18738
|
|
|
18739
18739
|
> `optional` **keep?**: `boolean`
|
|
18740
18740
|
|
|
18741
|
-
Defined in: [lib/undici.ts:
|
|
18741
|
+
Defined in: [lib/undici.ts:733](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L733)
|
|
18742
18742
|
|
|
18743
18743
|
连接是否保持长连接(即是否允许复用),默认为 true
|
|
18744
18744
|
|
|
@@ -18748,7 +18748,7 @@ Defined in: [lib/undici.ts:711](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
18748
18748
|
|
|
18749
18749
|
> `optional` **local?**: `string`
|
|
18750
18750
|
|
|
18751
|
-
Defined in: [lib/undici.ts:
|
|
18751
|
+
Defined in: [lib/undici.ts:722](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L722)
|
|
18752
18752
|
|
|
18753
18753
|
***
|
|
18754
18754
|
|
|
@@ -18756,7 +18756,7 @@ Defined in: [lib/undici.ts:700](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
18756
18756
|
|
|
18757
18757
|
> `optional` **log?**: `boolean`
|
|
18758
18758
|
|
|
18759
|
-
Defined in: [lib/undici.ts:
|
|
18759
|
+
Defined in: [lib/undici.ts:739](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L739)
|
|
18760
18760
|
|
|
18761
18761
|
若有异常写入文件日志,默认为 true
|
|
18762
18762
|
|
|
@@ -18766,7 +18766,7 @@ Defined in: [lib/undici.ts:717](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
18766
18766
|
|
|
18767
18767
|
> `optional` **method?**: `"GET"` \| `"POST"` \| `"PUT"` \| `"DELETE"` \| `"OPTIONS"`
|
|
18768
18768
|
|
|
18769
|
-
Defined in: [lib/undici.ts:
|
|
18769
|
+
Defined in: [lib/undici.ts:713](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L713)
|
|
18770
18770
|
|
|
18771
18771
|
***
|
|
18772
18772
|
|
|
@@ -18774,7 +18774,7 @@ Defined in: [lib/undici.ts:691](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
18774
18774
|
|
|
18775
18775
|
> `optional` **mproxy?**: `object`
|
|
18776
18776
|
|
|
18777
|
-
Defined in: [lib/undici.ts:
|
|
18777
|
+
Defined in: [lib/undici.ts:725](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L725)
|
|
18778
18778
|
|
|
18779
18779
|
正向 mproxy 代理,url 如 https://xxx/abc
|
|
18780
18780
|
|
|
@@ -18802,7 +18802,7 @@ Defined in: [lib/undici.ts:703](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
18802
18802
|
|
|
18803
18803
|
> `optional` **reuse?**: `string` \| `Agent` \| `ProxyAgent`
|
|
18804
18804
|
|
|
18805
|
-
Defined in: [lib/undici.ts:
|
|
18805
|
+
Defined in: [lib/undici.ts:735](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L735)
|
|
18806
18806
|
|
|
18807
18807
|
复用池名/Agent,默认为 default
|
|
18808
18808
|
|
|
@@ -18812,7 +18812,7 @@ Defined in: [lib/undici.ts:713](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
18812
18812
|
|
|
18813
18813
|
> `optional` **save?**: `string`
|
|
18814
18814
|
|
|
18815
|
-
Defined in: [lib/undici.ts:
|
|
18815
|
+
Defined in: [lib/undici.ts:721](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L721)
|
|
18816
18816
|
|
|
18817
18817
|
***
|
|
18818
18818
|
|
|
@@ -18820,7 +18820,7 @@ Defined in: [lib/undici.ts:699](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
18820
18820
|
|
|
18821
18821
|
> `optional` **signal?**: `AbortSignal`
|
|
18822
18822
|
|
|
18823
|
-
Defined in: [lib/undici.ts:
|
|
18823
|
+
Defined in: [lib/undici.ts:741](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L741)
|
|
18824
18824
|
|
|
18825
18825
|
请求中止信号
|
|
18826
18826
|
|
|
@@ -18830,7 +18830,7 @@ Defined in: [lib/undici.ts:719](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
18830
18830
|
|
|
18831
18831
|
> `optional` **timeout?**: `number`
|
|
18832
18832
|
|
|
18833
|
-
Defined in: [lib/undici.ts:
|
|
18833
|
+
Defined in: [lib/undici.ts:716](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L716)
|
|
18834
18834
|
|
|
18835
18835
|
秒数,默认 300 秒
|
|
18836
18836
|
|
|
@@ -18840,7 +18840,7 @@ Defined in: [lib/undici.ts:694](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
18840
18840
|
|
|
18841
18841
|
> `optional` **type?**: `"form"` \| `"json"`
|
|
18842
18842
|
|
|
18843
|
-
Defined in: [lib/undici.ts:
|
|
18843
|
+
Defined in: [lib/undici.ts:714](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L714)
|
|
18844
18844
|
|
|
18845
18845
|
lib/undici/interfaces/IRproxyOptions.md
|
|
18846
18846
|
---
|
|
@@ -18853,7 +18853,7 @@ lib/undici/interfaces/IRproxyOptions.md
|
|
|
18853
18853
|
|
|
18854
18854
|
# Interface: IRproxyOptions
|
|
18855
18855
|
|
|
18856
|
-
Defined in: [lib/undici.ts:
|
|
18856
|
+
Defined in: [lib/undici.ts:760](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L760)
|
|
18857
18857
|
|
|
18858
18858
|
反向代理请求的传入参数选项
|
|
18859
18859
|
|
|
@@ -18863,7 +18863,7 @@ Defined in: [lib/undici.ts:738](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
18863
18863
|
|
|
18864
18864
|
> `optional` **filter?**: (`h`) => `boolean`
|
|
18865
18865
|
|
|
18866
|
-
Defined in: [lib/undici.ts:
|
|
18866
|
+
Defined in: [lib/undici.ts:769](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L769)
|
|
18867
18867
|
|
|
18868
18868
|
过滤 header,返回 true 则留下
|
|
18869
18869
|
|
|
@@ -18883,7 +18883,7 @@ Defined in: [lib/undici.ts:747](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
18883
18883
|
|
|
18884
18884
|
> `optional` **follow?**: `number`
|
|
18885
18885
|
|
|
18886
|
-
Defined in: [lib/undici.ts:
|
|
18886
|
+
Defined in: [lib/undici.ts:763](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L763)
|
|
18887
18887
|
|
|
18888
18888
|
***
|
|
18889
18889
|
|
|
@@ -18891,7 +18891,7 @@ Defined in: [lib/undici.ts:741](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
18891
18891
|
|
|
18892
18892
|
> `optional` **headers?**: [`THttpHeaders`](../type-aliases/THttpHeaders.md)
|
|
18893
18893
|
|
|
18894
|
-
Defined in: [lib/undici.ts:
|
|
18894
|
+
Defined in: [lib/undici.ts:767](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L767)
|
|
18895
18895
|
|
|
18896
18896
|
***
|
|
18897
18897
|
|
|
@@ -18899,7 +18899,7 @@ Defined in: [lib/undici.ts:745](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
18899
18899
|
|
|
18900
18900
|
> `optional` **hosts?**: `string` \| `Record`\<`string`, `string`\>
|
|
18901
18901
|
|
|
18902
|
-
Defined in: [lib/undici.ts:
|
|
18902
|
+
Defined in: [lib/undici.ts:765](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L765)
|
|
18903
18903
|
|
|
18904
18904
|
自定义 host 映射,如 {'www.maiyun.net': '127.0.0.1'},或全部映射到一个 host
|
|
18905
18905
|
|
|
@@ -18909,7 +18909,7 @@ Defined in: [lib/undici.ts:743](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
18909
18909
|
|
|
18910
18910
|
> `optional` **local?**: `string`
|
|
18911
18911
|
|
|
18912
|
-
Defined in: [lib/undici.ts:
|
|
18912
|
+
Defined in: [lib/undici.ts:766](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L766)
|
|
18913
18913
|
|
|
18914
18914
|
***
|
|
18915
18915
|
|
|
@@ -18917,7 +18917,7 @@ Defined in: [lib/undici.ts:744](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
18917
18917
|
|
|
18918
18918
|
> `optional` **mproxy?**: `object`
|
|
18919
18919
|
|
|
18920
|
-
Defined in: [lib/undici.ts:
|
|
18920
|
+
Defined in: [lib/undici.ts:771](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L771)
|
|
18921
18921
|
|
|
18922
18922
|
正向 mproxy 代理,url 如 https://xxx/abc
|
|
18923
18923
|
|
|
@@ -18941,11 +18941,31 @@ Defined in: [lib/undici.ts:749](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
18941
18941
|
|
|
18942
18942
|
***
|
|
18943
18943
|
|
|
18944
|
+
### querys?
|
|
18945
|
+
|
|
18946
|
+
> `optional` **querys?**: `Record`\<`string`, `any`\>
|
|
18947
|
+
|
|
18948
|
+
Defined in: [lib/undici.ts:781](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L781)
|
|
18949
|
+
|
|
18950
|
+
追加的 GET 查询参数,会与代理目标 URL 已有 query string 合并(同名参数覆盖)
|
|
18951
|
+
|
|
18952
|
+
***
|
|
18953
|
+
|
|
18954
|
+
### querysBlacklist?
|
|
18955
|
+
|
|
18956
|
+
> `optional` **querysBlacklist?**: `string`[]
|
|
18957
|
+
|
|
18958
|
+
Defined in: [lib/undici.ts:779](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L779)
|
|
18959
|
+
|
|
18960
|
+
需要从原始 URL 中剔除的 GET 查询参数名列表(在合并 querys 之前执行)
|
|
18961
|
+
|
|
18962
|
+
***
|
|
18963
|
+
|
|
18944
18964
|
### reuse?
|
|
18945
18965
|
|
|
18946
18966
|
> `optional` **reuse?**: `string` \| `Agent` \| `ProxyAgent`
|
|
18947
18967
|
|
|
18948
|
-
Defined in: [lib/undici.ts:
|
|
18968
|
+
Defined in: [lib/undici.ts:783](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L783)
|
|
18949
18969
|
|
|
18950
18970
|
默认为 default
|
|
18951
18971
|
|
|
@@ -18955,7 +18975,7 @@ Defined in: [lib/undici.ts:757](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
18955
18975
|
|
|
18956
18976
|
> `optional` **timeout?**: `number`
|
|
18957
18977
|
|
|
18958
|
-
Defined in: [lib/undici.ts:
|
|
18978
|
+
Defined in: [lib/undici.ts:762](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L762)
|
|
18959
18979
|
|
|
18960
18980
|
秒数,默认 300 秒
|
|
18961
18981
|
|
|
@@ -19444,7 +19464,7 @@ lib/undici/type-aliases/THttpHeaders.md
|
|
|
19444
19464
|
|
|
19445
19465
|
> **THttpHeaders** = `http.IncomingHttpHeaders` & `object`
|
|
19446
19466
|
|
|
19447
|
-
Defined in: [lib/undici.ts:
|
|
19467
|
+
Defined in: [lib/undici.ts:788](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L788)
|
|
19448
19468
|
|
|
19449
19469
|
http headers
|
|
19450
19470
|
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* --- 本文件用来定义每个目录实体地址的常量 ---
|
|
7
7
|
*/
|
|
8
8
|
/** --- 当前系统版本号 --- */
|
|
9
|
-
export const VER = '9.11.
|
|
9
|
+
export const VER = '9.11.8';
|
|
10
10
|
// --- 服务端用的路径 ---
|
|
11
11
|
const imu = decodeURIComponent(import.meta.url).replace('file://', '').replace(/^\/(\w:)/, '$1');
|
|
12
12
|
/** --- /xxx/xxx --- */
|
package/lib/undici.d.ts
CHANGED
|
@@ -165,6 +165,10 @@ export interface IRproxyOptions {
|
|
|
165
165
|
/** --- 落地端自定义 host 映射,如 {'www.maiyun.net': '127.0.0.1'},或全部映射到一个 host --- */
|
|
166
166
|
'hosts'?: Record<string, string> | string;
|
|
167
167
|
};
|
|
168
|
+
/** --- 需要从原始 URL 中剔除的 GET 查询参数名列表(在合并 querys 之前执行) --- */
|
|
169
|
+
'querysBlacklist'?: string[];
|
|
170
|
+
/** --- 追加的 GET 查询参数,会与代理目标 URL 已有 query string 合并(同名参数覆盖) --- */
|
|
171
|
+
'querys'?: Record<string, any>;
|
|
168
172
|
/** --- 默认为 default --- */
|
|
169
173
|
'reuse'?: string | undici.ProxyAgent | undici.Agent;
|
|
170
174
|
}
|
package/lib/undici.js
CHANGED
|
@@ -585,8 +585,30 @@ export async function rproxy(ctr, route, opt = {}) {
|
|
|
585
585
|
opt.method = req.method ?? 'GET';
|
|
586
586
|
opt.headers ??= {};
|
|
587
587
|
const headers = Object.assign(filterHeaders(req.headers, undefined, opt.filter), opt.headers);
|
|
588
|
+
// --- 拼接代理目标 URL ---
|
|
589
|
+
let proxyUrl = route[key] + lpath;
|
|
590
|
+
// --- 处理 GET 查询参数(剔除 + 追加) ---
|
|
591
|
+
if (opt.querysBlacklist || opt.querys) {
|
|
592
|
+
const parsed = lText.parseUrl(proxyUrl);
|
|
593
|
+
const queryObj = parsed.query ? lText.queryParse(parsed.query) : {};
|
|
594
|
+
// --- 剔除黑名单参数 ---
|
|
595
|
+
if (opt.querysBlacklist) {
|
|
596
|
+
for (const name of opt.querysBlacklist) {
|
|
597
|
+
delete queryObj[name];
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
// --- 合并追加参数(同名覆盖) ---
|
|
601
|
+
if (opt.querys) {
|
|
602
|
+
Object.assign(queryObj, opt.querys);
|
|
603
|
+
}
|
|
604
|
+
const newQueryStr = lText.queryStringify(queryObj);
|
|
605
|
+
const prefix = parsed.protocol
|
|
606
|
+
? parsed.protocol + '//' + (parsed.host ?? '') + parsed.pathname
|
|
607
|
+
: parsed.pathname;
|
|
608
|
+
proxyUrl = prefix + (newQueryStr ? '?' + newQueryStr : '') + (parsed.hash ? '#' + parsed.hash : '');
|
|
609
|
+
}
|
|
588
610
|
// --- 发起请求 ---
|
|
589
|
-
const rres = await request(
|
|
611
|
+
const rres = await request(proxyUrl, req, {
|
|
590
612
|
...opt,
|
|
591
613
|
headers,
|
|
592
614
|
});
|