xjs-common 9.1.6 → 9.1.7
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.
|
@@ -1,7 +1,19 @@
|
|
|
1
|
-
import { ClientMode } from "./http-resolver";
|
|
2
1
|
import { ClientOption, HttpResponse, IHttpClient, RequestOption } from "./i-http-client";
|
|
3
2
|
import { Loggable } from "../../const/types";
|
|
4
|
-
export declare const s_clientMode:
|
|
3
|
+
export declare const s_clientMode: {
|
|
4
|
+
nodejs: {
|
|
5
|
+
id: number;
|
|
6
|
+
cipherOrder: any;
|
|
7
|
+
};
|
|
8
|
+
chrome: {
|
|
9
|
+
id: number;
|
|
10
|
+
cipherOrder: number[];
|
|
11
|
+
};
|
|
12
|
+
firefox: {
|
|
13
|
+
id: number;
|
|
14
|
+
cipherOrder: number[];
|
|
15
|
+
};
|
|
16
|
+
};
|
|
5
17
|
export declare class HttpResolverContext implements IHttpClient {
|
|
6
18
|
readonly cmv: number;
|
|
7
19
|
private _l;
|
|
@@ -96,10 +96,11 @@ class HttpResolverContext {
|
|
|
96
96
|
this.cmv = cmv;
|
|
97
97
|
this._l = _l;
|
|
98
98
|
this._mode = op?.mode ?? u_array_1.UArray.randomPick([exports.s_clientMode.chrome, exports.s_clientMode.firefox]);
|
|
99
|
-
if (this._mode.id > 0)
|
|
100
|
-
this._ciphers = this.createCiphers(this._mode);
|
|
101
99
|
this._proxyConfig = op?.proxy;
|
|
102
|
-
|
|
100
|
+
if (this._mode.id > 0) {
|
|
101
|
+
this._ciphers = this.createCiphers(this._mode);
|
|
102
|
+
this._chHeaders = s_mode2headers.get(this._mode)(this.cmv);
|
|
103
|
+
}
|
|
103
104
|
}
|
|
104
105
|
/**
|
|
105
106
|
* request GET to the url.
|