diff options
author | Quentin Dufour <quentin@deuxfleurs.fr> | 2024-05-29 09:57:34 +0200 |
---|---|---|
committer | Quentin Dufour <quentin@deuxfleurs.fr> | 2024-05-29 09:57:34 +0200 |
commit | 06a24bb5598226edcedaaa1e3ba122ef6a40a793 (patch) | |
tree | 4b3e59e3c0a9721e34db8c9295e082d4f62d3b22 /aero-proto/src/dav/controller.rs | |
parent | 3a8b45a0b1d96fb404267956c3cb723ad7d99339 (diff) | |
download | aerogramme-06a24bb5598226edcedaaa1e3ba122ef6a40a793.tar.gz aerogramme-06a24bb5598226edcedaaa1e3ba122ef6a40a793.zip |
fix DAV header for iOS
Diffstat (limited to 'aero-proto/src/dav/controller.rs')
-rw-r--r-- | aero-proto/src/dav/controller.rs | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/aero-proto/src/dav/controller.rs b/aero-proto/src/dav/controller.rs index 76dd15d..8c53c6b 100644 --- a/aero-proto/src/dav/controller.rs +++ b/aero-proto/src/dav/controller.rs @@ -61,18 +61,19 @@ impl Controller { } }; + let dav_hdrs = node.dav_header(); let ctrl = Self { node, user, req }; match method.as_str() { "OPTIONS" => Ok(Response::builder() .status(200) - .header("DAV", "1") + .header("DAV", dav_hdrs) .header("Allow", "HEAD,GET,PUT,OPTIONS,DELETE,PROPFIND,PROPPATCH,MKCOL,COPY,MOVE,LOCK,UNLOCK,MKCALENDAR,REPORT") .body(codec::text_body(""))?), "HEAD" => { - tracing::warn!("HEAD not correctly implemented"); + tracing::warn!("HEAD might not correctly implemented: should return ETags & co"); Ok(Response::builder() - .status(404) + .status(200) .body(codec::text_body(""))?) }, "GET" => ctrl.get().await, @@ -348,11 +349,14 @@ impl Controller { } // Build response - dav::Multistatus::<All> { + let multistatus = dav::Multistatus::<All> { responses, responsedescription: None, extension, - } + }; + + tracing::debug!(multistatus=?multistatus, "multistatus response"); + multistatus } } |