wreq 1.3.2.2 → 1.3.2.3
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.
- checksums.yaml +4 -4
- data/Cargo.lock +10 -10
- data/Cargo.toml +2 -2
- data/README.md +11 -4
- data/VERSION +1 -1
- data/crates/wreq-util/src/emulate/macros.rs +31 -197
- data/crates/wreq-util/src/emulate/profile/chromium/chrome.rs +731 -0
- data/crates/wreq-util/src/emulate/profile/chromium/edge.rs +418 -0
- data/crates/wreq-util/src/emulate/profile/chromium/header.rs +74 -0
- data/crates/wreq-util/src/emulate/profile/chromium/http2.rs +59 -0
- data/crates/wreq-util/src/emulate/profile/chromium/opera.rs +312 -0
- data/crates/wreq-util/src/emulate/profile/{chrome → chromium}/tls.rs +146 -137
- data/crates/wreq-util/src/emulate/profile/chromium.rs +9 -0
- data/crates/wreq-util/src/emulate/profile/firefox/header.rs +48 -54
- data/crates/wreq-util/src/emulate/profile/firefox/http2.rs +92 -102
- data/crates/wreq-util/src/emulate/profile/firefox/tls.rs +155 -146
- data/crates/wreq-util/src/emulate/profile/firefox.rs +312 -440
- data/crates/wreq-util/src/emulate/profile.rs +5 -7
- data/crates/wreq-util/src/emulate.rs +33 -1
- data/crates/wreq-util/tests/client.rs +187 -46
- data/crates/wreq-util/tests/emulate_chrome.rs +7 -0
- data/crates/wreq-util/tests/emulate_firefox.rs +15 -0
- data/crates/wreq-util/tests/emulate_opera.rs +24 -0
- data/lib/wreq_ruby/emulate.rb +27 -0
- data/src/emulate.rs +27 -0
- data/test/emulation_client_hello_test.rb +142 -0
- data/test/emulation_test.rb +21 -105
- metadata +9 -9
- data/crates/wreq-util/src/emulate/profile/chrome/header.rs +0 -116
- data/crates/wreq-util/src/emulate/profile/chrome/http2.rs +0 -65
- data/crates/wreq-util/src/emulate/profile/chrome.rs +0 -2304
- data/crates/wreq-util/src/emulate/profile/opera/header.rs +0 -29
- data/crates/wreq-util/src/emulate/profile/opera/http2.rs +0 -50
- data/crates/wreq-util/src/emulate/profile/opera/tls.rs +0 -103
- data/crates/wreq-util/src/emulate/profile/opera.rs +0 -299
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cc190acbbd70c1403c163513ddb2f581ad545fda507b8cf883d61b5788de548d
|
|
4
|
+
data.tar.gz: 976514bd19cc1fa386219ab267e1cc2b219e6c0b38f09d91d9d559e7013bf27d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: be30774979b7bb61ab6dd1b12a76013566fd967e41a62060075f6058b4dcfb7975caa3b310e2b55e99cfc194b6bd1645d7938939b71b3a450e931153f0c49a9a
|
|
7
|
+
data.tar.gz: 7b9d1d54f1b736c39e0c5122f01e77965d4d2972ee8555185782e96dd608ddf0d6f82d1869533c941a6f81e129e14080be086984d1bbc9d354a2f4d406ef3cfc
|
data/Cargo.lock
CHANGED
|
@@ -699,9 +699,9 @@ dependencies = [
|
|
|
699
699
|
|
|
700
700
|
[[package]]
|
|
701
701
|
name = "magnus"
|
|
702
|
-
version = "0.
|
|
702
|
+
version = "0.9.4"
|
|
703
703
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
704
|
-
checksum = "
|
|
704
|
+
checksum = "3c5f2dd2017d172e2fde9969a35f10f1374a4dd79b37a17f1847f83201883de7"
|
|
705
705
|
dependencies = [
|
|
706
706
|
"bytes",
|
|
707
707
|
"magnus-macros",
|
|
@@ -712,9 +712,9 @@ dependencies = [
|
|
|
712
712
|
|
|
713
713
|
[[package]]
|
|
714
714
|
name = "magnus-macros"
|
|
715
|
-
version = "0.
|
|
715
|
+
version = "0.9.1"
|
|
716
716
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
717
|
-
checksum = "
|
|
717
|
+
checksum = "9dafde2eeb66f090e0f326112323eb8324b12cb32b5d1210e541d3df6b0ce77e"
|
|
718
718
|
dependencies = [
|
|
719
719
|
"proc-macro2",
|
|
720
720
|
"quote",
|
|
@@ -888,18 +888,18 @@ checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf"
|
|
|
888
888
|
|
|
889
889
|
[[package]]
|
|
890
890
|
name = "rb-sys"
|
|
891
|
-
version = "0.9.
|
|
891
|
+
version = "0.9.130"
|
|
892
892
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
893
|
-
checksum = "
|
|
893
|
+
checksum = "02faf625bb10ba893e3ae620f19c9fb1b5f8fcae0fe4eb86bb3f2230fad75edb"
|
|
894
894
|
dependencies = [
|
|
895
895
|
"rb-sys-build",
|
|
896
896
|
]
|
|
897
897
|
|
|
898
898
|
[[package]]
|
|
899
899
|
name = "rb-sys-build"
|
|
900
|
-
version = "0.9.
|
|
900
|
+
version = "0.9.130"
|
|
901
901
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
902
|
-
checksum = "
|
|
902
|
+
checksum = "05be6f9c86fe5482808162826f6c047d093b3670582296c770de1d94f8066694"
|
|
903
903
|
dependencies = [
|
|
904
904
|
"bindgen 0.72.1",
|
|
905
905
|
"lazy_static",
|
|
@@ -1229,9 +1229,9 @@ dependencies = [
|
|
|
1229
1229
|
|
|
1230
1230
|
[[package]]
|
|
1231
1231
|
name = "tokio"
|
|
1232
|
-
version = "1.
|
|
1232
|
+
version = "1.54.1"
|
|
1233
1233
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1234
|
-
checksum = "
|
|
1234
|
+
checksum = "b52fd3255258d26fac7264ab5a76b53c13367136dc011d3d6ad4f8ed070396a3"
|
|
1235
1235
|
dependencies = [
|
|
1236
1236
|
"bytes",
|
|
1237
1237
|
"libc",
|
data/Cargo.toml
CHANGED
|
@@ -14,7 +14,7 @@ doc = false
|
|
|
14
14
|
name = "wreq_ruby"
|
|
15
15
|
|
|
16
16
|
[dependencies]
|
|
17
|
-
magnus = { version = "0.
|
|
17
|
+
magnus = { version = "0.9.0", features = ["bytes"] }
|
|
18
18
|
rb-sys = { version = "0.9.128", default-features = false }
|
|
19
19
|
tokio = { version = "1.53.1", features = ["full"] }
|
|
20
20
|
# Keep the existing trust store independent of wreq's default feature selection.
|
|
@@ -54,7 +54,7 @@ futures-util = { version = "0.3.33", default-features = false }
|
|
|
54
54
|
forkguard = { version = "0.1.3", features = ["atfork"] }
|
|
55
55
|
|
|
56
56
|
[dev-dependencies]
|
|
57
|
-
magnus = { version = "0.
|
|
57
|
+
magnus = { version = "0.9.0", features = ["embed"] }
|
|
58
58
|
|
|
59
59
|
[build-dependencies]
|
|
60
60
|
rb-sys-env = "0.2.2"
|
data/README.md
CHANGED
|
@@ -89,14 +89,21 @@ Most browser device models share identical TLS and HTTP/2 configurations, differ
|
|
|
89
89
|
- <details>
|
|
90
90
|
<summary>Available browser emulations</summary>
|
|
91
91
|
|
|
92
|
+
Edge 149–158 provide request-header presets for Windows, macOS, Linux, Android, and iOS.
|
|
93
|
+
Firefox 153–160 provide Android and iPhone presets for `User-Agent` and `Accept-Language`.
|
|
94
|
+
Both use the same TLS and HTTP/2 settings as the corresponding desktop Firefox preset.
|
|
95
|
+
Opera 116–140 provide desktop request-header presets for Windows, macOS, and Linux.
|
|
96
|
+
|
|
92
97
|
| **Browser** | **Versions** |
|
|
93
98
|
| ----------- | ------------ |
|
|
94
99
|
| **Chrome** | `Chrome100`, `Chrome101`, `Chrome104`, `Chrome105`, `Chrome106`, `Chrome107`, `Chrome108`, `Chrome109`, `Chrome110`, `Chrome114`, `Chrome116`, `Chrome117`, `Chrome118`, `Chrome119`, `Chrome120`, `Chrome123`, `Chrome124`, `Chrome126`, `Chrome127`, `Chrome128`, `Chrome129`, `Chrome130`, `Chrome131`, `Chrome132`, `Chrome133`, `Chrome134`, `Chrome135`, `Chrome136`, `Chrome137`, `Chrome138`, `Chrome139`, `Chrome140`, `Chrome141`, `Chrome142`, `Chrome143`, `Chrome144`, `Chrome145`, `Chrome146`, `Chrome147`, `Chrome148`, `Chrome149`, `Chrome150`, `Chrome151`, `Chrome152`, `Chrome153`, `Chrome154`, `Chrome155`, `Chrome156`, `Chrome157`, `Chrome158` |
|
|
95
|
-
| **Edge** | `Edge101`, `Edge122`, `Edge127`, `Edge131`, `Edge134
|
|
96
|
-
| **Firefox** | `Firefox109`, `Firefox117`, `Firefox128`, `Firefox133`, `Firefox135`, `FirefoxPrivate135`, `FirefoxAndroid135`, `Firefox136`, `FirefoxPrivate136`, `Firefox139`, `Firefox142`, `Firefox143`, `Firefox144`, `Firefox145`, `Firefox146`, `Firefox147`, `Firefox148`, `Firefox149`, `Firefox150`, `Firefox151`, `Firefox152` |
|
|
100
|
+
| **Edge** | `Edge101`, `Edge122`, `Edge127`, `Edge131`, `Edge134`–`Edge158` |
|
|
101
|
+
| **Firefox** | `Firefox109`, `Firefox117`, `Firefox128`, `Firefox133`, `Firefox135`, `FirefoxPrivate135`, `FirefoxAndroid135`, `Firefox136`, `FirefoxPrivate136`, `Firefox139`, `Firefox142`, `Firefox143`, `Firefox144`, `Firefox145`, `Firefox146`, `Firefox147`, `Firefox148`, `Firefox149`, `Firefox150`, `Firefox151`, `Firefox152`, `Firefox153`–`Firefox160` |
|
|
97
102
|
| **Safari** | `Safari15_3`, `Safari15_5`, `Safari15_6_1`, `Safari16`, `Safari16_5`, `Safari17_0`, `Safari17_2_1`, `Safari17_4_1`, `Safari17_5`, `Safari17_6`, `Safari18`, `Safari18_2`, `Safari18_3`, `Safari18_3_1`, `Safari18_5`, `Safari26`, `Safari26_1`, `Safari26_2`, `SafariIos16_5`, `SafariIos17_2`, `SafariIos17_4_1`, `SafariIos18_1_1`, `SafariIos26`, `SafariIos26_2`, `SafariIPad18`, `SafariIPad26`, `SafariIpad26_2` |
|
|
98
|
-
| **OkHttp** | `
|
|
99
|
-
| **Opera** | `Opera116
|
|
103
|
+
| **OkHttp** | `OkHttp3_9`, `OkHttp3_11`, `OkHttp3_13`, `OkHttp3_14`, `OkHttp4_9`, `OkHttp4_10`, `OkHttp4_12`, `OkHttp5` |
|
|
104
|
+
| **Opera** | `Opera116`–`Opera140` |
|
|
105
|
+
|
|
106
|
+
Opera 132–140 use the corresponding Chromium desktop TLS and HTTP/2 defaults with Opera-branded request headers.
|
|
100
107
|
|
|
101
108
|
</details>
|
|
102
109
|
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.3.2.
|
|
1
|
+
1.3.2.3
|
|
@@ -84,103 +84,6 @@ macro_rules! define_enum {
|
|
|
84
84
|
};
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
macro_rules! header_chrome_sec_ch_ua {
|
|
88
|
-
($headers:expr, $ua:expr, $platform:expr, $is_mobile:expr) => {
|
|
89
|
-
let mobile = if $is_mobile { "?1" } else { "?0" };
|
|
90
|
-
$headers.insert("sec-ch-ua", HeaderValue::from_static($ua));
|
|
91
|
-
$headers.insert("sec-ch-ua-mobile", HeaderValue::from_static(mobile));
|
|
92
|
-
$headers.insert("sec-ch-ua-platform", HeaderValue::from_static($platform));
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
macro_rules! header_chrome_sec_fetch {
|
|
97
|
-
($headers:expr) => {
|
|
98
|
-
$headers.insert("sec-fetch-site", HeaderValue::from_static("none"));
|
|
99
|
-
$headers.insert("sec-fetch-mode", HeaderValue::from_static("navigate"));
|
|
100
|
-
$headers.insert("sec-fetch-user", HeaderValue::from_static("?1"));
|
|
101
|
-
$headers.insert("sec-fetch-dest", HeaderValue::from_static("document"));
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
macro_rules! header_chrome_ua {
|
|
106
|
-
($headers:expr, $ua:expr) => {
|
|
107
|
-
$headers.insert(USER_AGENT, HeaderValue::from_static($ua));
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
macro_rules! header_chrome_accept {
|
|
112
|
-
($headers:expr) => {
|
|
113
|
-
$headers.insert(ACCEPT, HeaderValue::from_static("text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7"));
|
|
114
|
-
};
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
macro_rules! header_chrome_accept_encoding {
|
|
118
|
-
($headers:expr) => {
|
|
119
|
-
#[cfg(feature = "emulation-compression")]
|
|
120
|
-
$headers.insert(
|
|
121
|
-
ACCEPT_ENCODING,
|
|
122
|
-
HeaderValue::from_static("gzip, deflate, br"),
|
|
123
|
-
);
|
|
124
|
-
$headers.insert(ACCEPT_LANGUAGE, HeaderValue::from_static("en-US,en;q=0.9"));
|
|
125
|
-
};
|
|
126
|
-
(zstd, $headers:expr) => {
|
|
127
|
-
#[cfg(feature = "emulation-compression")]
|
|
128
|
-
$headers.insert(
|
|
129
|
-
ACCEPT_ENCODING,
|
|
130
|
-
HeaderValue::from_static("gzip, deflate, br, zstd"),
|
|
131
|
-
);
|
|
132
|
-
$headers.insert(ACCEPT_LANGUAGE, HeaderValue::from_static("en-US,en;q=0.9"));
|
|
133
|
-
};
|
|
134
|
-
(zstd_only, $headers:expr) => {
|
|
135
|
-
#[cfg(feature = "emulation-compression")]
|
|
136
|
-
$headers.insert(
|
|
137
|
-
ACCEPT_ENCODING,
|
|
138
|
-
HeaderValue::from_static("gzip, deflate, br, zstd"),
|
|
139
|
-
);
|
|
140
|
-
};
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
macro_rules! header_firefox_sec_fetch {
|
|
144
|
-
($headers:expr) => {
|
|
145
|
-
$headers.insert("sec-fetch-dest", HeaderValue::from_static("document"));
|
|
146
|
-
$headers.insert("sec-fetch-mode", HeaderValue::from_static("navigate"));
|
|
147
|
-
$headers.insert("sec-fetch-site", HeaderValue::from_static("none"));
|
|
148
|
-
$headers.insert("sec-fetch-user", HeaderValue::from_static("?1"));
|
|
149
|
-
};
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
macro_rules! header_firefox_accept {
|
|
153
|
-
($headers:expr) => {
|
|
154
|
-
header_firefox_accept!(@build $headers, "en-US,en;q=0.5", "gzip, deflate, br");
|
|
155
|
-
};
|
|
156
|
-
(zstd, $headers:expr) => {
|
|
157
|
-
header_firefox_accept!(@build $headers, "en-US,en;q=0.5", "gzip, deflate, br, zstd");
|
|
158
|
-
};
|
|
159
|
-
// Firefox 147 changed the generated q-value from dividing 1.0 across the list to
|
|
160
|
-
// decrementing by 0.1 per entry, so a two-entry list became q=0.9 (Bugzilla 2000765,
|
|
161
|
-
// landed in 0e050ae5116d).
|
|
162
|
-
(zstd_q09, $headers:expr) => {
|
|
163
|
-
header_firefox_accept!(@build $headers, "en-US,en;q=0.9", "gzip, deflate, br, zstd");
|
|
164
|
-
};
|
|
165
|
-
(@build $headers:expr, $accept_language:expr, $accept_encoding:expr) => {
|
|
166
|
-
$headers.insert(
|
|
167
|
-
ACCEPT,
|
|
168
|
-
HeaderValue::from_static(
|
|
169
|
-
"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
|
|
170
|
-
),
|
|
171
|
-
);
|
|
172
|
-
$headers.insert(ACCEPT_LANGUAGE, HeaderValue::from_static($accept_language));
|
|
173
|
-
#[cfg(feature = "emulation-compression")]
|
|
174
|
-
$headers.insert(ACCEPT_ENCODING, HeaderValue::from_static($accept_encoding));
|
|
175
|
-
};
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
macro_rules! header_firefox_ua {
|
|
179
|
-
($headers:expr, $ua:expr) => {
|
|
180
|
-
$headers.insert(USER_AGENT, HeaderValue::from_static($ua));
|
|
181
|
-
};
|
|
182
|
-
}
|
|
183
|
-
|
|
184
87
|
macro_rules! join {
|
|
185
88
|
($sep:expr, $first:expr $(, $rest:expr)*) => {
|
|
186
89
|
concat!($first $(, $sep, $rest)*)
|
|
@@ -231,84 +134,22 @@ macro_rules! fixed_headers {
|
|
|
231
134
|
macro_rules! platform_headers {
|
|
232
135
|
(
|
|
233
136
|
$emulation:expr,
|
|
234
|
-
$
|
|
235
|
-
|
|
137
|
+
$header_preset:path,
|
|
138
|
+
$brands:literal,
|
|
139
|
+
[($default_os:ident, $default_ua:literal) $(, ($other_os:ident, $other_ua:literal))* $(,)?]
|
|
236
140
|
) => {{
|
|
237
141
|
#[allow(unreachable_patterns)]
|
|
238
142
|
$emulation.headers.then(|| {
|
|
239
|
-
match $emulation.platform {
|
|
240
|
-
$(
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
$emulation.platform,
|
|
245
|
-
),
|
|
246
|
-
)*
|
|
247
|
-
_ => $header_initializer(
|
|
248
|
-
$default_sec_ch_ua,
|
|
249
|
-
$default_ua,
|
|
250
|
-
Platform::$default_os,
|
|
251
|
-
),
|
|
252
|
-
}
|
|
253
|
-
})
|
|
254
|
-
}};
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
macro_rules! firefox_platform_headers {
|
|
258
|
-
($emulation:expr, $header_initializer:ident, [($default_os:ident, $default_ua:tt) $(, ($other_os:ident, $other_ua:tt))*]) => {{
|
|
259
|
-
#[allow(unreachable_patterns)]
|
|
260
|
-
$emulation.headers.then(|| {
|
|
261
|
-
match $emulation.platform {
|
|
262
|
-
$(
|
|
263
|
-
Platform::$other_os => $header_initializer($other_ua),
|
|
264
|
-
)*
|
|
265
|
-
_ => $header_initializer($default_ua),
|
|
266
|
-
}
|
|
143
|
+
let (ua, platform) = match $emulation.platform {
|
|
144
|
+
$( Platform::$other_os => ($other_ua, Platform::$other_os), )*
|
|
145
|
+
_ => ($default_ua, Platform::$default_os),
|
|
146
|
+
};
|
|
147
|
+
($header_preset).build($brands, ua, platform)
|
|
267
148
|
})
|
|
268
149
|
}};
|
|
269
150
|
}
|
|
270
151
|
|
|
271
152
|
macro_rules! mod_generator {
|
|
272
|
-
(
|
|
273
|
-
$mod_name:ident,
|
|
274
|
-
$tls_options:expr,
|
|
275
|
-
$http2_options:expr,
|
|
276
|
-
$header_initializer:ident,
|
|
277
|
-
[($default_os:ident, $default_sec_ch_ua:tt, $default_ua:tt) $(, ($other_os:ident, $other_sec_ch_ua:tt, $other_ua:tt))*]
|
|
278
|
-
) => {
|
|
279
|
-
standard_mod_generator!(
|
|
280
|
-
$mod_name,
|
|
281
|
-
$tls_options,
|
|
282
|
-
$http2_options,
|
|
283
|
-
|emulation: &Emulation| {
|
|
284
|
-
platform_headers!(
|
|
285
|
-
emulation,
|
|
286
|
-
$header_initializer,
|
|
287
|
-
[($default_os, $default_sec_ch_ua, $default_ua) $(, ($other_os, $other_sec_ch_ua, $other_ua))*]
|
|
288
|
-
)
|
|
289
|
-
}
|
|
290
|
-
);
|
|
291
|
-
};
|
|
292
|
-
(
|
|
293
|
-
$mod_name:ident,
|
|
294
|
-
$tls_options:expr,
|
|
295
|
-
$http2_options:expr,
|
|
296
|
-
$header_initializer:ident,
|
|
297
|
-
[($default_os:ident, $default_ua:tt) $(, ($other_os:ident, $other_ua:tt))*]
|
|
298
|
-
) => {
|
|
299
|
-
standard_mod_generator!(
|
|
300
|
-
$mod_name,
|
|
301
|
-
$tls_options,
|
|
302
|
-
$http2_options,
|
|
303
|
-
|emulation: &Emulation| {
|
|
304
|
-
firefox_platform_headers!(
|
|
305
|
-
emulation,
|
|
306
|
-
$header_initializer,
|
|
307
|
-
[($default_os, $default_ua) $(, ($other_os, $other_ua))*]
|
|
308
|
-
)
|
|
309
|
-
}
|
|
310
|
-
);
|
|
311
|
-
};
|
|
312
153
|
(
|
|
313
154
|
$mod_name:ident,
|
|
314
155
|
$tls_options:expr,
|
|
@@ -327,48 +168,41 @@ macro_rules! mod_generator {
|
|
|
327
168
|
$mod_name:ident,
|
|
328
169
|
$build_emulation:expr,
|
|
329
170
|
$header_initializer:ident,
|
|
330
|
-
|
|
171
|
+
$ua:expr
|
|
331
172
|
) => {
|
|
332
173
|
standard_mod_generator!(
|
|
333
174
|
$mod_name,
|
|
334
175
|
$build_emulation,
|
|
335
|
-
|emulation: &Emulation|
|
|
336
|
-
platform_headers!(
|
|
337
|
-
emulation,
|
|
338
|
-
$header_initializer,
|
|
339
|
-
[($default_os, $default_sec_ch_ua, $default_ua) $(, ($other_os, $other_sec_ch_ua, $other_ua))*]
|
|
340
|
-
)
|
|
341
|
-
}
|
|
176
|
+
|emulation: &Emulation| fixed_headers!(emulation, $header_initializer, $ua)
|
|
342
177
|
);
|
|
343
178
|
};
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
macro_rules! chromium_profile {
|
|
344
182
|
(
|
|
345
|
-
$
|
|
346
|
-
$
|
|
347
|
-
$
|
|
348
|
-
|
|
183
|
+
$name:ident,
|
|
184
|
+
tls: $tls:path,
|
|
185
|
+
http2: $http2:path,
|
|
186
|
+
headers: $headers:path,
|
|
187
|
+
brands: $brands:literal,
|
|
188
|
+
$platforms:tt $(,)?
|
|
349
189
|
) => {
|
|
350
190
|
standard_mod_generator!(
|
|
351
|
-
$
|
|
352
|
-
$
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
emulation,
|
|
356
|
-
$header_initializer,
|
|
357
|
-
[($default_os, $default_ua) $(, ($other_os, $other_ua))*]
|
|
358
|
-
)
|
|
359
|
-
}
|
|
191
|
+
$name,
|
|
192
|
+
($tls).build(),
|
|
193
|
+
($http2).build(),
|
|
194
|
+
|emulation: &Emulation| platform_headers!(emulation, $headers, $brands, $platforms)
|
|
360
195
|
);
|
|
361
196
|
};
|
|
362
197
|
(
|
|
363
|
-
$
|
|
364
|
-
$
|
|
365
|
-
$
|
|
366
|
-
$
|
|
198
|
+
$name:ident,
|
|
199
|
+
transport: $transport:path,
|
|
200
|
+
headers: $headers:path,
|
|
201
|
+
brands: $brands:literal,
|
|
202
|
+
$platforms:tt $(,)?
|
|
367
203
|
) => {
|
|
368
|
-
standard_mod_generator!(
|
|
369
|
-
$
|
|
370
|
-
|
|
371
|
-
|emulation: &Emulation| fixed_headers!(emulation, $header_initializer, $ua)
|
|
372
|
-
);
|
|
204
|
+
standard_mod_generator!($name, $transport, |emulation: &Emulation| {
|
|
205
|
+
platform_headers!(emulation, $headers, $brands, $platforms)
|
|
206
|
+
});
|
|
373
207
|
};
|
|
374
208
|
}
|