Implement If-Match, If-None-Match for DELETE method

This commit is contained in:
Lennart
2025-02-06 15:17:49 +01:00
parent 6caa04a516
commit 180295ef1a
6 changed files with 61 additions and 8 deletions

View File

@@ -60,9 +60,6 @@ pub async fn put_event<C: CalendarStore>(
return Ok(HttpResponse::Unauthorized().body(""));
}
// TODO: implement If-Match
//
let overwrite =
Some(&HeaderValue::from_static("*")) != req.headers().get(header::IF_NONE_MATCH);

View File

@@ -90,6 +90,10 @@ impl Resource for CalendarObjectResource {
Some(&self.principal)
}
fn get_etag(&self) -> Option<String> {
Some(self.object.get_etag())
}
fn get_user_privileges(&self, user: &User) -> Result<UserPrivilegeSet, Self::Error> {
Ok(UserPrivilegeSet::owner_only(
user.is_principal(&self.principal),