diff --git a/src/main.rs b/src/main.rs index 1203bb0..fd8c409 100644 --- a/src/main.rs +++ b/src/main.rs @@ -174,7 +174,7 @@ async fn main() -> std::io::Result<()> { .service(askama) .service( webx::resource("/git/{owner}/{repo}.git") - .route(webx::get().to(repo::git_main)) + .route(webx::get().to(repo::git_main::)) ) .service(hello_session) .service(chunk) diff --git a/src/web/repo.rs b/src/web/repo.rs index 8c872e9..f78f820 100644 --- a/src/web/repo.rs +++ b/src/web/repo.rs @@ -1,3 +1,4 @@ +use crate::auth::AuthValidator; use std::path::Path; use actix_web::web; @@ -56,11 +57,12 @@ pub struct GitWebQ { } //#[get("/git/{owner}/{repo}.git")] -pub async fn git_main( +pub async fn git_main( web::Path((ownername, reponame)): web::Path<(String, String)>, web::Query(GitWebQ{commit : commitnameopt, path : pathopt, branch : branchopt}) : web::Query, gitust : web::Data, auth : Option, + validator : web::Data, //auth : BasicAuth, ) -> Result, Vec<(String, String)>>, error::Error> { // let authtorization = auth.ok_or(error::Error::Unauthorized("safe repo".to_string()))?;