mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-13 14:42:30 +00:00
@@ -1,5 +1,9 @@
|
||||
use super::methods::{axum_route_propfind, axum_route_proppatch};
|
||||
use crate::resource::{ResourceService, axum_methods::AxumMethods};
|
||||
use crate::resource::{
|
||||
ResourceService,
|
||||
axum_methods::AxumMethods,
|
||||
methods::{axum_route_copy, axum_route_move},
|
||||
};
|
||||
use axum::{
|
||||
body::Body,
|
||||
extract::FromRequestParts,
|
||||
@@ -51,12 +55,18 @@ where
|
||||
Handler::with_state(axum_route_proppatch::<RS>, self.resource_service.clone());
|
||||
let mut delete_service =
|
||||
Handler::with_state(axum_route_delete::<RS>, self.resource_service.clone());
|
||||
let mut move_service =
|
||||
Handler::with_state(axum_route_move::<RS>, self.resource_service.clone());
|
||||
let mut copy_service =
|
||||
Handler::with_state(axum_route_copy::<RS>, self.resource_service.clone());
|
||||
let mut options_service = Handler::with_state(route_options::<RS>, ());
|
||||
match req.method().as_str() {
|
||||
"PROPFIND" => return Box::pin(Service::call(&mut propfind_service, req)),
|
||||
"PROPPATCH" => return Box::pin(Service::call(&mut proppatch_service, req)),
|
||||
"DELETE" => return Box::pin(Service::call(&mut delete_service, req)),
|
||||
"OPTIONS" => return Box::pin(Service::call(&mut options_service, req)),
|
||||
"MOVE" => return Box::pin(Service::call(&mut move_service, req)),
|
||||
"COPY" => return Box::pin(Service::call(&mut copy_service, req)),
|
||||
"REPORT" => {
|
||||
if let Some(svc) = RS::report() {
|
||||
return svc(self.resource_service.clone(), req);
|
||||
@@ -87,16 +97,6 @@ where
|
||||
return svc(self.resource_service.clone(), req);
|
||||
}
|
||||
}
|
||||
"COPY" => {
|
||||
if let Some(svc) = RS::copy() {
|
||||
return svc(self.resource_service.clone(), req);
|
||||
}
|
||||
}
|
||||
"MOVE" => {
|
||||
if let Some(svc) = RS::mv() {
|
||||
return svc(self.resource_service.clone(), req);
|
||||
}
|
||||
}
|
||||
"PUT" => {
|
||||
if let Some(svc) = RS::put() {
|
||||
return svc(self.resource_service.clone(), req);
|
||||
|
||||
Reference in New Issue
Block a user