In short, reqwest sends a `content-length: 0` header in GET requests for a reason maybe related to this issue: https://github.com/seanmonstar/reqwest/issues/1971 For now, let's ignore Content-Length header lines.
Unified · Split
| @@ -160,6 +160,7 @@ fn http_authentication_error_can_be_differentiated_and_identity_is_transmitted() · 159 unmodified lines | ||
| 160 | 160 | .received_as_string() |
| 161 | 161 | .lines() |
| 162 | 162 | .map(str::to_lowercase) |
| 163 | + .filter(ignore_reqwest_content_length) | |
| 163 | 164 | .collect::<HashSet<_>>(), |
| 164 | 165 | format!( |
| 165 | 166 | "GET /path/not-important/info/refs?service=git-upload-pack HTTP/1.1 |
| @@ -187,6 +188,7 @@ Authorization: Basic dXNlcjpwYXNzd29yZA== · 21 unmodified lines | ||
| 187 | 188 | .lines() |
| 188 | 189 | .map(str::to_lowercase) |
| 189 | 190 | .filter(|l| !l.starts_with("expect: ")) |
| 191 | + .filter(ignore_reqwest_content_length) | |
| 190 | 192 | .collect::<HashSet<_>>(); |
| 191 | 193 | // On linux on CI, for some reason, it won't have this chunk id here, but |
| 192 | 194 | // it has it whenever and where-ever I run it. |
| @@ -337,6 +339,7 @@ fn handshake_v1() -> crate::Result { · 144 unmodified lines | ||
| 337 | 339 | .received_as_string() |
| 338 | 340 | .lines() |
| 339 | 341 | .map(str::to_lowercase) |
| 342 | + .filter(ignore_reqwest_content_length) | |
| 340 | 343 | .collect::<HashSet<_>>(), |
| 341 | 344 | format!( |
| 342 | 345 | "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 · 207 unmodified lines | ||
| 550 | 553 | .received_as_string() |
| 551 | 554 | .lines() |
| 552 | 555 | .map(str::to_lowercase) |
| 556 | + .filter(ignore_reqwest_content_length) | |
| 553 | 557 | .collect::<HashSet<_>>(), |
| 554 | 558 | format!( |
| 555 | 559 | "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 { · 124 unmodified lines | ||
| 680 | 684 | assert!(result.is_ok()); |
| 681 | 685 | Ok(()) |
| 682 | 686 | } |
| 687 | + | |
| 688 | +fn ignore_reqwest_content_length(header_line: &String) -> bool { | |
| 689 | + header_line != "content-length: 0" | |
| 690 | +} | |