Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 25 additions & 38 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 9 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ homepage = "https://github.com/SearchApi/wreq-ruby"
repository = "https://github.com/SearchApi/wreq-ruby"
edition = "2024"
version = "1.3.2"
rust-version = "1.98"
rust-version = "1.100"

[lib]
crate-type = ["cdylib"]
Expand All @@ -20,6 +20,7 @@ tokio = { version = "1.53.1", features = ["full"] }
# Keep the existing trust store independent of wreq's default feature selection.
wreq = { version = "0.16.1", default-features = false, features = [
"tokio-rt",
"http2",
"chromium-roots",
"query",
"form",
Expand Down Expand Up @@ -67,9 +68,11 @@ opt-level = 3
strip = true

[patch.crates-io]
http2 = { git = "https://github.com/0x676e67/http2", rev = "29b3bdfc7560d6f84119c103311afa147488b6f0" }
btls = { git = "https://github.com/0x676e67/btls", rev = "5ec1c113a03626a5877b34dd6d2ea8d440897a91" }
btls-sys = { git = "https://github.com/0x676e67/btls", rev = "5ec1c113a03626a5877b34dd6d2ea8d440897a91" }
tokio-btls = { git = "https://github.com/0x676e67/btls", rev = "5ec1c113a03626a5877b34dd6d2ea8d440897a91" }
wreq = { git = "https://github.com/0x676e67/wreq", rev = "74fc1469b5c54b3fb93037e48f136b569d0fe418" }
# Match the Git patches used by wreq main; Cargo.lock pins the exact revisions.
btls = { git = "https://github.com/0x676e67/btls", branch = "main" }
btls-sys = { git = "https://github.com/0x676e67/btls", branch = "main" }
tokio-btls = { git = "https://github.com/0x676e67/btls", branch = "main" }
http2 = { git = "https://github.com/0x676e67/http2", branch = "master" }
netty = { git = "https://github.com/0x676e67/netty", branch = "main" }
wreq = { git = "https://github.com/0x676e67/wreq", branch = "main" }
wreq-util = { path = "crates/wreq-util" }
1 change: 1 addition & 0 deletions crates/wreq-util/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ emulation = [
"dep:zstd",
"dep:chromium-roots",
"wreq/chromium-roots",
"wreq/http2",
]
emulation-serde = ["dep:serde"]
emulation-compression = []
Expand Down
4 changes: 2 additions & 2 deletions crates/wreq-util/src/emulate/profile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ use wreq::{
Group,
header::{ACCEPT, ACCEPT_LANGUAGE, HeaderMap, HeaderName, HeaderValue, USER_AGENT},
http2::{
Http2Options, Priorities, Priority, PseudoId, PseudoOrder, SettingId, SettingsOrder,
StreamDependency, StreamId,
HeadersDependency, HeadersPriority, Http2Options, Priorities, Priority, PseudoId,
PseudoOrder, SettingId, SettingsOrder, StreamDependency, StreamId,
},
tls::{
AlpnProtocol, AlpsProtocol, EchGrease, EchGreaseAead, ExtensionType, KeyShare, Tls13Cipher,
Expand Down
6 changes: 3 additions & 3 deletions crates/wreq-util/src/emulate/profile/chrome/http2.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
macro_rules! headers_stream_dependency {
macro_rules! headers_priority {
() => {
StreamDependency::new(StreamId::zero(), 255, true)
HeadersPriority::new(HeadersDependency::Root, 255, true)
};
}

Expand Down Expand Up @@ -41,7 +41,7 @@ macro_rules! http2_options {
.initial_connection_window_size(15728640)
.max_header_list_size(262144)
.header_table_size(65536)
.headers_stream_dependency(headers_stream_dependency!())
.headers_priority(headers_priority!())
.headers_pseudo_order(pseudo_order!())
.settings_order(settings_order!())
};
Expand Down
22 changes: 11 additions & 11 deletions crates/wreq-util/src/emulate/profile/firefox/http2.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
macro_rules! headers_stream_dependency {
macro_rules! headers_priority {
(1) => {
StreamDependency::new(StreamId::zero(), 41, false)
HeadersPriority::new(HeadersDependency::Root, 41, false)
};
(2) => {
StreamDependency::new(StreamId::from(13), 41, false)
HeadersPriority::new(HeadersDependency::Declared(13_u32.into()), 41, false)
};
}

Expand Down Expand Up @@ -52,28 +52,28 @@ macro_rules! http2_options {
.initial_stream_id(3)
.header_table_size(65536)
.enable_push(false)
.headers_stream_dependency(headers_stream_dependency!(1))
.headers_priority(headers_priority!(1))
.build()
};
(2) => {
http2_options!(@base Http2Options::builder())
.initial_stream_id(15)
.header_table_size(65536)
.headers_stream_dependency(headers_stream_dependency!(2))
.headers_priority(headers_priority!(2))
.priorities(
Priorities::builder()
.extend([
Priority::new(
StreamId::from(3),
StreamDependency::new(StreamId::zero(), 200, false),
StreamDependency::new(StreamId::from(0), 200, false),
),
Priority::new(
StreamId::from(5),
StreamDependency::new(StreamId::zero(), 100, false),
StreamDependency::new(StreamId::from(0), 100, false),
),
Priority::new(
StreamId::from(7),
StreamDependency::new(StreamId::zero(), 0, false),
StreamDependency::new(StreamId::from(0), 0, false),
),
Priority::new(
StreamId::from(9),
Expand All @@ -85,7 +85,7 @@ macro_rules! http2_options {
),
Priority::new(
StreamId::from(13),
StreamDependency::new(StreamId::zero(), 240, false),
StreamDependency::new(StreamId::from(0), 240, false),
),
])
.build(),
Expand All @@ -98,7 +98,7 @@ macro_rules! http2_options {
.header_table_size(65536)
.enable_push(false)
.max_concurrent_streams(0)
.headers_stream_dependency(headers_stream_dependency!(1))
.headers_priority(headers_priority!(1))
.build()
};
(4) => {
Expand All @@ -107,7 +107,7 @@ macro_rules! http2_options {
.header_table_size(4096)
.enable_push(false)
.initial_window_size(32768)
.headers_stream_dependency(headers_stream_dependency!(1))
.headers_priority(headers_priority!(1))
.build()
};
}
6 changes: 3 additions & 3 deletions crates/wreq-util/src/emulate/profile/opera/http2.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
macro_rules! headers_stream_dependency {
macro_rules! headers_priority {
() => {
StreamDependency::new(StreamId::zero(), 255, true)
HeadersPriority::new(HeadersDependency::Root, 255, true)
};
}

Expand Down Expand Up @@ -42,7 +42,7 @@ macro_rules! http2_options {
.max_header_list_size(262144)
.header_table_size(65536)
.enable_push(false)
.headers_stream_dependency(headers_stream_dependency!())
.headers_priority(headers_priority!())
.headers_pseudo_order(pseudo_order!())
.settings_order(settings_order!())
.build()
Expand Down
2 changes: 1 addition & 1 deletion wreq.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Gem::Specification.new do |spec|
# Exclude non-Ruby files from RDoc to prevent parsing errors
spec.rdoc_options = ["--exclude", "Cargo\\..*", "--exclude", "\\.rs$"]

spec.requirements = ["Rust >= 1.98"]
spec.requirements = ["Rust >= 1.100"]
# use a Ruby version which:
# - supports Rubygems with the ability of compilation of Rust gem
# - not end of life
Expand Down
Loading