aboutsummaryrefslogtreecommitdiff
path: root/aero-proto/src
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2024-05-22 23:22:03 +0200
committerQuentin Dufour <quentin@deuxfleurs.fr>2024-05-22 23:22:03 +0200
commit2ca485fb87125b543307748e73b04bcd68f2d9ad (patch)
tree5fa7f5b04fb2afc6929413f8bbc0497a4322483c /aero-proto/src
parente522251bec3519b4ca867e6ef5131c6fdf6cd2b1 (diff)
downloadaerogramme-2ca485fb87125b543307748e73b04bcd68f2d9ad.tar.gz
aerogramme-2ca485fb87125b543307748e73b04bcd68f2d9ad.zip
test webdav core get, delete, update
Diffstat (limited to 'aero-proto/src')
-rw-r--r--aero-proto/src/dav/controller.rs10
1 files changed, 9 insertions, 1 deletions
diff --git a/aero-proto/src/dav/controller.rs b/aero-proto/src/dav/controller.rs
index 306b035..0a47cf4 100644
--- a/aero-proto/src/dav/controller.rs
+++ b/aero-proto/src/dav/controller.rs
@@ -223,7 +223,15 @@ impl Controller {
})
.boxed();
- let etag = self.node.put(put_policy, stream_of_bytes).await?;
+ let etag = match self.node.put(put_policy, stream_of_bytes).await {
+ Ok(etag) => etag,
+ Err(e) if e.kind() == std::io::ErrorKind::AlreadyExists => {
+ tracing::warn!("put pre-condition failed");
+ let response = Response::builder().status(412).body(text_body(""))?;
+ return Ok(response);
+ }
+ Err(e) => Err(e)?,
+ };
let response = Response::builder()
.status(201)