src/server/plugins/postgresql/webdav.c

branch
webdav
changeset 311
e676ed461b5b
parent 309
fc021bd576d4
child 312
f7544e220a0f
--- a/src/server/plugins/postgresql/webdav.c	Mon Apr 25 18:33:03 2022 +0200
+++ b/src/server/plugins/postgresql/webdav.c	Mon Apr 25 19:28:52 2022 +0200
@@ -413,9 +413,17 @@
             }
             if(vfsprops.getlastmodified) {
                 char *lastmodified = PQgetvalue(result, r, 5);
+                time_t t = pg_convert_timestamp(lastmodified);
+                struct tm tm;
+                gmtime_r(&t, &tm);
+                
+                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));
             }
             if(vfsprops.creationdate) {
                 char *creationdate = PQgetvalue(result, r, 6);
+                webdav_resource_add_dav_stringproperty(resource, pool, "creationdate", creationdate, strlen(creationdate));
             }
             if(vfsprops.getcontentlength) {
                 char *contentlength = PQgetvalue(result, r, 7);

mercurial