mirror of
https://github.com/rust-lang/cargo.git
synced 2025-10-01 11:30:39 +00:00
Drop the libgit2 User-Agent testing from http_auth_offered
This commit is contained in:
parent
2fb77a49b4
commit
85d1dc042d
@ -16,7 +16,7 @@ fn http_auth_offered() {
|
|||||||
let addr = server.local_addr().unwrap();
|
let addr = server.local_addr().unwrap();
|
||||||
|
|
||||||
fn headers(rdr: &mut BufRead) -> HashSet<String> {
|
fn headers(rdr: &mut BufRead) -> HashSet<String> {
|
||||||
let valid = ["GET", "Authorization", "Accept", "User-Agent"];
|
let valid = ["GET", "Authorization", "Accept"];
|
||||||
rdr.lines()
|
rdr.lines()
|
||||||
.map(|s| s.unwrap())
|
.map(|s| s.unwrap())
|
||||||
.take_while(|s| s.len() > 2)
|
.take_while(|s| s.len() > 2)
|
||||||
@ -28,7 +28,6 @@ fn http_auth_offered() {
|
|||||||
let t = thread::spawn(move || {
|
let t = thread::spawn(move || {
|
||||||
let mut conn = BufStream::new(server.accept().unwrap().0);
|
let mut conn = BufStream::new(server.accept().unwrap().0);
|
||||||
let req = headers(&mut conn);
|
let req = headers(&mut conn);
|
||||||
let user_agent = "User-Agent: git/2.0 (libgit2 0.27.0)";
|
|
||||||
conn.write_all(
|
conn.write_all(
|
||||||
b"\
|
b"\
|
||||||
HTTP/1.1 401 Unauthorized\r\n\
|
HTTP/1.1 401 Unauthorized\r\n\
|
||||||
@ -41,7 +40,6 @@ fn http_auth_offered() {
|
|||||||
vec![
|
vec![
|
||||||
"GET /foo/bar/info/refs?service=git-upload-pack HTTP/1.1",
|
"GET /foo/bar/info/refs?service=git-upload-pack HTTP/1.1",
|
||||||
"Accept: */*",
|
"Accept: */*",
|
||||||
user_agent,
|
|
||||||
].into_iter()
|
].into_iter()
|
||||||
.map(|s| s.to_string())
|
.map(|s| s.to_string())
|
||||||
.collect()
|
.collect()
|
||||||
@ -63,7 +61,6 @@ fn http_auth_offered() {
|
|||||||
"GET /foo/bar/info/refs?service=git-upload-pack HTTP/1.1",
|
"GET /foo/bar/info/refs?service=git-upload-pack HTTP/1.1",
|
||||||
"Authorization: Basic Zm9vOmJhcg==",
|
"Authorization: Basic Zm9vOmJhcg==",
|
||||||
"Accept: */*",
|
"Accept: */*",
|
||||||
user_agent,
|
|
||||||
].into_iter()
|
].into_iter()
|
||||||
.map(|s| s.to_string())
|
.map(|s| s.to_string())
|
||||||
.collect()
|
.collect()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user