mirror of
https://forge.pointfixe.fr/hubert/gitust.git
synced 2026-02-04 16:27:28 +01:00
push OK, clone KO
This commit is contained in:
@@ -125,6 +125,7 @@ async fn git_main(web::Path((owner, reponame)): web::Path<(String, String)>, web
|
|||||||
}
|
}
|
||||||
//#[get("/git/{owner}/{repo}.git/{path:.*}")]
|
//#[get("/git/{owner}/{repo}.git/{path:.*}")]
|
||||||
async fn git_proto(payload : web::Payload, web::Path((owner, reponame)): web::Path<(String, String)>, mut req: HttpRequest) -> io::Result<HttpResponse>{
|
async fn git_proto(payload : web::Payload, web::Path((owner, reponame)): web::Path<(String, String)>, mut req: HttpRequest) -> io::Result<HttpResponse>{
|
||||||
|
println!("enter git_proto");
|
||||||
let mut cmd = Command::new("git");
|
let mut cmd = Command::new("git");
|
||||||
cmd.arg("http-backend");
|
cmd.arg("http-backend");
|
||||||
|
|
||||||
@@ -154,6 +155,7 @@ async fn git_proto(payload : web::Payload, web::Path((owner, reponame)): web::Pa
|
|||||||
input.write(bytes.bytes());
|
input.write(bytes.bytes());
|
||||||
future::ready(Ok(()))
|
future::ready(Ok(()))
|
||||||
}).await;
|
}).await;
|
||||||
|
println!("input sent");
|
||||||
//io::copy(&mut req.take_payload(), &mut p.stdin.take().unwrap())?;
|
//io::copy(&mut req.take_payload(), &mut p.stdin.take().unwrap())?;
|
||||||
// Parse the headers coming out, and the pass through the rest of the
|
// Parse the headers coming out, and the pass through the rest of the
|
||||||
// process back down the stack.
|
// process back down the stack.
|
||||||
@@ -201,7 +203,7 @@ async fn git_proto(payload : web::Payload, web::Path((owner, reponame)): web::Pa
|
|||||||
|
|
||||||
let mut body = Vec::new();
|
let mut body = Vec::new();
|
||||||
rdr.read_to_end(&mut body)?;
|
rdr.read_to_end(&mut body)?;
|
||||||
println!("{}", String::from_utf8(body.clone()).expect("bad utf8"));
|
// println!("{}", String::from_utf8(body.clone()).expect("bad utf8"));
|
||||||
return Ok(builder.body(body));
|
return Ok(builder.body(body));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user