This commit is contained in:
Hubert 2021-07-07 21:39:42 +02:00
parent de08947fe7
commit e267539e53
1 changed files with 3 additions and 2 deletions

View File

@ -25,6 +25,7 @@ use std::collections::HashMap;
use std::io::{Read, BufRead, Write};
use futures::{StreamExt, TryStreamExt, future};
use actix_web::web::Buf;
use actix_web::http::header::IntoHeaderValue;
#[derive(Template)]
#[template(path = "hello.html")]
@ -186,13 +187,13 @@ async fn git_proto(payload : web::Payload, web::Path((owner, reponame)): web::Pa
let mut builder = HttpResponse::build(StatusCode::from_u16(status_code)?);
for (name, vec) in headers.iter() {
for value in vec {
builder = builder.header(name, value);
builder.header(name, value.clone());
}
}
let mut body = Vec::new();
rdr.read_to_end(&mut body)?;
return Ok(builder.body(body).unwrap());
return Ok(builder.body(body));
}