src/server/webdav/multistatus.c

branch
webdav
changeset 237
ee1680ef1ef2
parent 233
c5985d2fc19a
child 238
e820d433f405
--- a/src/server/webdav/multistatus.c	Sun Jan 19 09:31:45 2020 +0100
+++ b/src/server/webdav/multistatus.c	Sun Jan 19 10:03:31 2020 +0100
@@ -552,6 +552,27 @@
         ret = REQ_ABORTED;
     }
     
+    // add missing properties with status code 404
+    UcxAllocator *a = session_get_allocator(response->multistatus->sn);
+    WebdavPList *pl = response->multistatus->response.op->reqprops;
+    while(pl) {
+        sstr_t key = sstrcat_a(
+            a,
+            3,
+            sstr((char*)pl->property->namespace->href),
+            S("\0"),
+            sstr((char*)pl->property->name));
+        if(!ucx_map_sstr_get(response->properties, key)) {
+            // property was not added to this response
+            if(msresponse_addproperror(response, pl->property, 404)) {
+                ret = REQ_ABORTED;
+                break;
+            }
+        }
+        
+        pl = pl->next;
+    }
+    
     // we don't need the properties anymore
     ucx_map_free(response->properties);
     

mercurial