mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-14 11:42:25 +00:00
Add handling for empty PROPFIND body to comply with spec
This commit is contained in:
@@ -66,8 +66,15 @@ pub async fn route_propfind<A: CheckAuthentication, R: ResourceService + ?Sized>
|
|||||||
|
|
||||||
let resource_service = R::new(req, auth_info.clone(), path_components.clone()).await?;
|
let resource_service = R::new(req, auth_info.clone(), path_components.clone()).await?;
|
||||||
|
|
||||||
let propfind: PropfindElement =
|
// A request body is optional. If empty we MUST return all props
|
||||||
quick_xml::de::from_str(&body).map_err(Error::XmlDecodeError)?;
|
let propfind: PropfindElement = if !body.is_empty() {
|
||||||
|
quick_xml::de::from_str(&body).map_err(Error::XmlDecodeError)?
|
||||||
|
} else {
|
||||||
|
PropfindElement {
|
||||||
|
prop: PropfindType::Allprop,
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
let props = match propfind.prop {
|
let props = match propfind.prop {
|
||||||
PropfindType::Allprop => {
|
PropfindType::Allprop => {
|
||||||
vec!["allprop".to_owned()]
|
vec!["allprop".to_owned()]
|
||||||
|
|||||||
Reference in New Issue
Block a user