fix pg propfind for getlastmodified property webdav

Mon, 25 Apr 2022 22:38:05 +0200

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Mon, 25 Apr 2022 22:38:05 +0200
branch
webdav
changeset 314
6b1a6066ee43
parent 313
3ad0b65ec838
child 315
b608b7aa43a6

fix pg propfind for getlastmodified property

src/server/plugins/postgresql/webdav.c file | annotate | diff | comparison | revisions
--- a/src/server/plugins/postgresql/webdav.c	Mon Apr 25 22:35:30 2022 +0200
+++ b/src/server/plugins/postgresql/webdav.c	Mon Apr 25 22:38:05 2022 +0200
@@ -418,13 +418,13 @@
                 
                 char buf[HTTP_DATE_LEN+1];
                 strftime(buf, HTTP_DATE_LEN, HTTP_DATE_FMT, &tm);
-                webdav_resource_add_dav_stringproperty(resource, pool, "getcontentlength", buf, strlen(buf));
+                webdav_resource_add_dav_stringproperty(resource, pool, "getlastmodified", buf, strlen(buf));
             }
             if(vfsprops.creationdate) {
                 char *creationdate = PQgetvalue(result, r, 6);
                 webdav_resource_add_dav_stringproperty(resource, pool, "creationdate", creationdate, strlen(creationdate));
             }
-            if(vfsprops.getcontentlength) {
+            if(vfsprops.getcontentlength && !iscollection) {
                 char *contentlength = PQgetvalue(result, r, 7);
                 webdav_resource_add_dav_stringproperty(resource, pool, "getcontentlength", contentlength, strlen(contentlength));
             }

mercurial