Skip to content

Commit a052d6a

Browse files
committed
adjust expectations to deal with reqwest Content-Length
In short, reqwest sends a `content-length: 0` header in GET requests for a reason maybe related to this issue: seanmonstar/reqwest#1971 For now, let's ignore Content-Length header lines.
1 parent 5c2a65a commit a052d6a

File tree

1 file changed

+5
-0
lines changed
  • gix-transport/tests/client/blocking_io/http

1 file changed

+5
-0
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,7 @@ fn handshake_v1() -> crate::Result {
337337
.received_as_string()
338338
.lines()
339339
.map(str::to_lowercase)
340+
.filter(ignore_reqwest_content_length)
340341
.collect::<HashSet<_>>(),
341342
format!(
342343
"GET /path/not/important/due/to/mock/info/refs?service=git-upload-pack HTTP/1.1
@@ -680,3 +681,7 @@ fn check_content_type_is_case_insensitive() -> crate::Result {
680681
assert!(result.is_ok());
681682
Ok(())
682683
}
684+
685+
fn ignore_reqwest_content_length(header_line: &String) -> bool {
686+
header_line != "content-length: 0"
687+
}

0 commit comments

Comments
 (0)