WebDAV: Fix dead property updates (closes #1611)
This commit is contained in:
@@ -61,7 +61,7 @@ impl DeadProperty {
|
||||
let mut remove = false;
|
||||
self.0.retain(|item| match item {
|
||||
DeadPropertyTag::ElementStart(tag) => {
|
||||
if depth == 0 && !remove && tag == element {
|
||||
if depth == 0 && !remove && tag.name == element.name {
|
||||
remove = true;
|
||||
}
|
||||
depth += 1;
|
||||
|
||||
@@ -92,7 +92,7 @@ pub(crate) enum DavQueryFilter {
|
||||
|
||||
pub(crate) trait ETag {
|
||||
fn etag(&self) -> String;
|
||||
fn ctag(&self) -> String;
|
||||
//fn ctag(&self) -> String;
|
||||
}
|
||||
|
||||
pub(crate) trait ExtractETag {
|
||||
@@ -104,9 +104,9 @@ impl<T> ETag for Archive<T> {
|
||||
format!("\"{}\"", self.version.hash().unwrap_or_default())
|
||||
}
|
||||
|
||||
fn ctag(&self) -> String {
|
||||
/*fn ctag(&self) -> String {
|
||||
format!("\"{}\"", self.version.change_id().unwrap_or_default())
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
impl ExtractETag for BatchBuilder {
|
||||
|
||||
@@ -496,13 +496,25 @@ pub async fn test(test: &WebDavTest) {
|
||||
(
|
||||
DavProperty::DeadProperty(DeadElementTag::new(
|
||||
"my-dead-element".to_string(),
|
||||
Some("xmlns=\"http://example.com/ns/\"".to_string()),
|
||||
Some("xmlns=\"http://example.com/ns/\" prop=\"abc\"".to_string()),
|
||||
)),
|
||||
"this is a dead but exciting element",
|
||||
),
|
||||
],
|
||||
)
|
||||
.await;
|
||||
client
|
||||
.patch_and_check(
|
||||
path,
|
||||
[(
|
||||
DavProperty::DeadProperty(DeadElementTag::new(
|
||||
"my-dead-element".to_string(),
|
||||
Some("xmlns=\"http://example.com/ns/\" prop=\"xyz\"".to_string()),
|
||||
)),
|
||||
"this is a modified dead but exciting element",
|
||||
)],
|
||||
)
|
||||
.await;
|
||||
|
||||
// Test 13: PROPPATCH remove on DAV properties
|
||||
let mut props = vec![
|
||||
|
||||
Reference in New Issue
Block a user