Skip to content

Commit 8fde62b

Browse files
committedMar 21, 2024··
Merge branch 'patch-1'
2 parents 3b34699 + adee500 commit 8fde62b

File tree

5 files changed

+160
-220
lines changed

5 files changed

+160
-220
lines changed
 

‎Cargo.lock

+141-211
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Cargo.toml

+2
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,8 @@ members = [
304304
prodash = { version = "28.0.0", default-features = false }
305305
futures-lite = { version = "2.1.0", default-features = false, features = ["std"] }
306306
faster-hex = { version = "0.9.0", default-features = false }
307+
reqwest = { version = "0.12.0", default-features = false, features = ["charset", "http2", "macos-system-configuration"] } # all but the 'default-tls' feature
308+
curl = { version = "0.4" }
307309

308310
[package.metadata.docs.rs]
309311
features = ["document-features", "max"]

‎gix-transport/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,10 @@ pin-project-lite = { version = "0.2.6", optional = true }
7575
base64 = { version = "0.21.0", optional = true }
7676

7777
# for http-client-curl. Additional configuration should be performed on higher levels of the dependency tree.
78-
curl = { version = "0.4", optional = true }
78+
curl = { workspace = true, optional = true }
7979

8080
# for http-client-reqwest
81-
reqwest = { version = "0.11.12", optional = true, default-features = false, features = ["blocking"] }
81+
reqwest = { workspace = true, optional = true, features = ["blocking"] }
8282

8383
## If used in conjunction with `async-client`, the `connect()` method will become available along with supporting the git protocol over TCP,
8484
## where the TCP stream is created using this crate.

‎gix-transport/tests/client/blocking_io/http/mod.rs

+8
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ fn http_authentication_error_can_be_differentiated_and_identity_is_transmitted()
160160
.received_as_string()
161161
.lines()
162162
.map(str::to_lowercase)
163+
.filter(ignore_reqwest_content_length)
163164
.collect::<HashSet<_>>(),
164165
format!(
165166
"GET /path/not-important/info/refs?service=git-upload-pack HTTP/1.1
@@ -187,6 +188,7 @@ Authorization: Basic dXNlcjpwYXNzd29yZA==
187188
.lines()
188189
.map(str::to_lowercase)
189190
.filter(|l| !l.starts_with("expect: "))
191+
.filter(ignore_reqwest_content_length)
190192
.collect::<HashSet<_>>();
191193
// On linux on CI, for some reason, it won't have this chunk id here, but
192194
// it has it whenever and where-ever I run it.
@@ -337,6 +339,7 @@ fn handshake_v1() -> crate::Result {
337339
.received_as_string()
338340
.lines()
339341
.map(str::to_lowercase)
342+
.filter(ignore_reqwest_content_length)
340343
.collect::<HashSet<_>>(),
341344
format!(
342345
"GET /path/not/important/due/to/mock/info/refs?service=git-upload-pack HTTP/1.1
@@ -550,6 +553,7 @@ fn handshake_and_lsrefs_and_fetch_v2_impl(handshake_fixture: &str) -> crate::Res
550553
.received_as_string()
551554
.lines()
552555
.map(str::to_lowercase)
556+
.filter(ignore_reqwest_content_length)
553557
.collect::<HashSet<_>>(),
554558
format!(
555559
"GET /path/not/important/due/to/mock/info/refs?service=git-upload-pack HTTP/1.1
@@ -680,3 +684,7 @@ fn check_content_type_is_case_insensitive() -> crate::Result {
680684
assert!(result.is_ok());
681685
Ok(())
682686
}
687+
688+
fn ignore_reqwest_content_length(header_line: &String) -> bool {
689+
header_line != "content-length: 0"
690+
}

‎gix/Cargo.toml

+7-7
Original file line numberDiff line numberDiff line change
@@ -127,16 +127,16 @@ blocking-network-client = ["gix-protocol/blocking-client", "gix-pack/streaming-i
127127
## Stacks with `blocking-network-client` to provide support for HTTP/S using **curl**, and implies blocking networking as a whole, making the `https://` transport available.
128128
blocking-http-transport-curl = ["blocking-network-client", "gix-transport/http-client-curl"]
129129
## Stacks with `blocking-http-transport-curl` and also enables the `rustls` backend to avoid `openssl`.
130-
blocking-http-transport-curl-rustls = ["blocking-http-transport-curl", "dep:curl-for-configuration-only", "curl-for-configuration-only?/rustls"]
130+
blocking-http-transport-curl-rustls = ["blocking-http-transport-curl", "dep:curl", "curl?/rustls"]
131131
## Stacks with `blocking-network-client` to provide support for HTTP/S using **reqwest**, and implies blocking networking as a whole, making the `https://` transport available.
132132
blocking-http-transport-reqwest = ["blocking-network-client", "gix-transport/http-client-reqwest"]
133133
## Stacks with `blocking-http-transport-reqwest` and enables `https://` via the `rustls` crate.
134-
blocking-http-transport-reqwest-rust-tls = ["blocking-http-transport-reqwest", "reqwest-for-configuration-only/rustls-tls"]
134+
blocking-http-transport-reqwest-rust-tls = ["blocking-http-transport-reqwest", "reqwest/rustls-tls"]
135135
## Stacks with `blocking-http-transport-reqwest` and enables `https://` via the `rustls` crate.
136136
## This also makes use of `trust-dns` to avoid `getaddrinfo`, but note it comes with its own problems.
137-
blocking-http-transport-reqwest-rust-tls-trust-dns = ["blocking-http-transport-reqwest", "reqwest-for-configuration-only/rustls-tls", "reqwest-for-configuration-only/trust-dns"]
137+
blocking-http-transport-reqwest-rust-tls-trust-dns = ["blocking-http-transport-reqwest", "reqwest/rustls-tls", "reqwest/trust-dns"]
138138
## Stacks with `blocking-http-transport-reqwest` and enables `https://` via the `native-tls` crate.
139-
blocking-http-transport-reqwest-native-tls = ["blocking-http-transport-reqwest", "reqwest-for-configuration-only/default-tls"]
139+
blocking-http-transport-reqwest-native-tls = ["blocking-http-transport-reqwest", "reqwest/default-tls"]
140140

141141

142142
#! #### Performance
@@ -305,8 +305,8 @@ serde = { version = "1.0.114", optional = true, default-features = false, featur
305305
smallvec = "1.9.0"
306306
async-std = { version = "1.12.0", optional = true }
307307

308-
# Must match the one in `gix-transport`.
309-
curl-for-configuration-only = { package = "curl", version = "0.4", optional = true }
308+
# Used for feature-configuration only.
309+
curl = { workspace = true, optional = true }
310310

311311
## For use in rev-parse, which provides searching commits by running a regex on their message.
312312
##
@@ -315,7 +315,7 @@ curl-for-configuration-only = { package = "curl", version = "0.4", optional = tr
315315
regex = { version = "1.6.0", optional = true, default-features = false, features = ["std"] }
316316

317317
# For internal use to allow pure-Rust builds without openssl.
318-
reqwest-for-configuration-only = { package = "reqwest", version = "0.11.13", default-features = false, optional = true }
318+
reqwest = { workspace = true, optional = true }
319319

320320
# for `interrupt` module
321321
parking_lot = "0.12.1"

0 commit comments

Comments
 (0)
Please sign in to comment.