Skip to content

Commit 0bb8047

Browse files
committed
Auto merge of #3657 - Keruspe:rust-1.16.0, r=alexcrichton
ensure libressl compatibility like #3644 but for the rust-1.16.0 branch
2 parents ec1e036 + 4d6f6ba commit 0bb8047

File tree

2 files changed

+40
-18
lines changed

2 files changed

+40
-18
lines changed

Cargo.lock

Lines changed: 33 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/build-auth.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ fn http_auth_offered() {
3333
let t = thread::spawn(move|| {
3434
let mut conn = BufStream::new(server.accept().unwrap().0);
3535
let req = headers(&mut conn);
36+
let user_agent = if cfg!(windows) {
37+
"User-Agent: git/1.0 (libgit2 0.25.0)"
38+
} else {
39+
"User-Agent: git/2.0 (libgit2 0.25.0)"
40+
};
3641
conn.write_all(b"\
3742
HTTP/1.1 401 Unauthorized\r\n\
3843
WWW-Authenticate: Basic realm=\"wheee\"\r\n
@@ -41,7 +46,7 @@ fn http_auth_offered() {
4146
assert_eq!(req, vec![
4247
"GET /foo/bar/info/refs?service=git-upload-pack HTTP/1.1",
4348
"Accept: */*",
44-
"User-Agent: git/1.0 (libgit2 0.24.0)",
49+
user_agent,
4550
].into_iter().map(|s| s.to_string()).collect());
4651
drop(conn);
4752

@@ -56,7 +61,7 @@ fn http_auth_offered() {
5661
"GET /foo/bar/info/refs?service=git-upload-pack HTTP/1.1",
5762
"Authorization: Basic Zm9vOmJhcg==",
5863
"Accept: */*",
59-
"User-Agent: git/1.0 (libgit2 0.24.0)",
64+
user_agent,
6065
].into_iter().map(|s| s.to_string()).collect());
6166
});
6267

0 commit comments

Comments
 (0)