diff --git a/crates/dav/src/resource/axum_methods.rs b/crates/dav/src/resource/axum_methods.rs index ee01680..638f9ee 100644 --- a/crates/dav/src/resource/axum_methods.rs +++ b/crates/dav/src/resource/axum_methods.rs @@ -38,6 +38,11 @@ pub trait AxumMethods: Sized + Send + Sync + 'static { None } + #[inline] + fn import() -> Option> { + None + } + #[inline] fn allow_header() -> Allow { let mut allow = vec![ @@ -67,6 +72,9 @@ pub trait AxumMethods: Sized + Send + Sync + 'static { if Self::put().is_some() { allow.push(Method::PUT); } + if Self::import().is_some() { + allow.push(Method::from_str("IMPORT").unwrap()); + } allow.into_iter().collect() } diff --git a/crates/dav/src/resource/axum_service.rs b/crates/dav/src/resource/axum_service.rs index 4e602f2..20487b5 100644 --- a/crates/dav/src/resource/axum_service.rs +++ b/crates/dav/src/resource/axum_service.rs @@ -97,6 +97,11 @@ where return svc(self.resource_service.clone(), req); } } + "IMPORT" => { + if let Some(svc) = RS::import() { + return svc(self.resource_service.clone(), req); + } + } _ => {} }; Box::pin(async move {