This commit is contained in:
Gvidas Juknevičius 2024-03-30 17:49:43 +02:00
parent d0defb101e
commit 74dd2bf6d9
Signed by: MCorange
GPG Key ID: 12B1346D720B7FBB
2 changed files with 2 additions and 10 deletions

View File

@ -7,13 +7,6 @@ use actix_web::{http::header, web::{self, Bytes, Data}, HttpRequest, HttpRespons
use crate::database::{models, Database}; use crate::database::{models, Database};
pub fn get_scope() -> Scope {
Scope::new("/github")
.route("/", web::get().to(HttpResponse::Ok))
.route("/", web::post().to(handler))
}
pub async fn handler(req: HttpRequest, body: Bytes, db: Data<Mutex<Database>>) -> Result<impl Responder> { pub async fn handler(req: HttpRequest, body: Bytes, db: Data<Mutex<Database>>) -> Result<impl Responder> {
let Some(auth) = req.headers().get(header::AUTHORIZATION) else { let Some(auth) = req.headers().get(header::AUTHORIZATION) else {
return Ok(HttpResponse::Unauthorized()); return Ok(HttpResponse::Unauthorized());

View File

@ -6,7 +6,6 @@ pub mod github;
pub fn get_scope() -> Scope { pub fn get_scope() -> Scope {
Scope::new("/wh") Scope::new("/wh")
.route("/", web::get().to(HttpResponse::Ok)) .route("/", web::get().to(HttpResponse::Ok))
.service( .route("/github", web::get().to(HttpResponse::Ok))
github::get_scope() .route("/github", web::post().to(github::handler))
)
} }