aboutsummaryrefslogtreecommitdiffstats
path: root/community/cargo/fix-test-build-auth.patch
diff options
context:
space:
mode:
Diffstat (limited to 'community/cargo/fix-test-build-auth.patch')
-rw-r--r--community/cargo/fix-test-build-auth.patch46
1 files changed, 46 insertions, 0 deletions
diff --git a/community/cargo/fix-test-build-auth.patch b/community/cargo/fix-test-build-auth.patch
new file mode 100644
index 0000000000..2fdb50c1c6
--- /dev/null
+++ b/community/cargo/fix-test-build-auth.patch
@@ -0,0 +1,46 @@
+From: Jakub Jirutka <jakub@jirutka.cz>
+Date: Thu, 13 Aug 2016 14:47:00 +0200
+Subject: [PATCH] Fix test build-auth:http_auth_offered
+
+The test fails because of hard-coded libgit2 version, that may not be
+the same as actually used libgit2...
+
+--- a/tests/build-auth.rs
++++ b/tests/build-auth.rs
+@@ -20,7 +20,7 @@
+ let addr = server.local_addr().unwrap();
+
+ fn headers(rdr: &mut BufRead) -> HashSet<String> {
+- let valid = ["GET", "Authorization", "Accept", "User-Agent"];
++ let valid = ["GET", "Authorization", "Accept"];
+ rdr.lines().map(|s| s.unwrap())
+ .take_while(|s| s.len() > 2)
+ .map(|s| s.trim().to_string())
+@@ -33,11 +33,6 @@
+ let t = thread::spawn(move|| {
+ let mut conn = BufStream::new(server.accept().unwrap().0);
+ let req = headers(&mut conn);
+- let user_agent = if cfg!(windows) {
+- "User-Agent: git/1.0 (libgit2 0.25.1)"
+- } else {
+- "User-Agent: git/2.0 (libgit2 0.25.1)"
+- };
+ conn.write_all(b"\
+ HTTP/1.1 401 Unauthorized\r\n\
+ WWW-Authenticate: Basic realm=\"wheee\"\r\n
+@@ -46,7 +41,6 @@
+ assert_eq!(req, vec![
+ "GET /foo/bar/info/refs?service=git-upload-pack HTTP/1.1",
+ "Accept: */*",
+- user_agent,
+ ].into_iter().map(|s| s.to_string()).collect());
+ drop(conn);
+
+@@ -61,7 +55,6 @@
+ "GET /foo/bar/info/refs?service=git-upload-pack HTTP/1.1",
+ "Authorization: Basic Zm9vOmJhcg==",
+ "Accept: */*",
+- user_agent,
+ ].into_iter().map(|s| s.to_string()).collect());
+ });
+