mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-14 05:52:19 +00:00
Implement almost all previous features
This commit is contained in:
@@ -11,10 +11,17 @@ pub(crate) async fn axum_route_delete<R: ResourceService>(
|
||||
Path(path): Path<R::PathComponents>,
|
||||
State(resource_service): State<R>,
|
||||
principal: R::Principal,
|
||||
if_match: Option<TypedHeader<IfMatch>>,
|
||||
if_none_match: Option<TypedHeader<IfNoneMatch>>,
|
||||
mut if_match: Option<TypedHeader<IfMatch>>,
|
||||
mut if_none_match: Option<TypedHeader<IfNoneMatch>>,
|
||||
header_map: HeaderMap,
|
||||
) -> Result<(), R::Error> {
|
||||
// https://github.com/hyperium/headers/issues/204
|
||||
if !header_map.contains_key("If-Match") {
|
||||
if_match = None;
|
||||
}
|
||||
if !header_map.contains_key("If-None-Match") {
|
||||
if_none_match = None;
|
||||
}
|
||||
let no_trash = header_map
|
||||
.get("X-No-Trashbin")
|
||||
.map(|val| matches!(val.to_str(), Ok("1")))
|
||||
@@ -46,6 +53,7 @@ pub async fn route_delete<R: ResourceService>(
|
||||
}
|
||||
|
||||
if let Some(if_match) = if_match {
|
||||
dbg!(&if_match);
|
||||
if !resource.satisfies_if_match(&if_match) {
|
||||
// Precondition failed
|
||||
return Err(crate::Error::PreconditionFailed.into());
|
||||
|
||||
@@ -10,7 +10,9 @@ use crate::xml::PropfindType;
|
||||
use axum::extract::{Extension, OriginalUri, Path, State};
|
||||
use rustical_xml::PropName;
|
||||
use rustical_xml::XmlDocument;
|
||||
use tracing::instrument;
|
||||
|
||||
#[instrument(skip(path, resource_service, puri))]
|
||||
pub(crate) async fn axum_route_propfind<R: ResourceService>(
|
||||
Path(path): Path<R::PathComponents>,
|
||||
State(resource_service): State<R>,
|
||||
|
||||
Reference in New Issue
Block a user