update etag when a postgresql file is updated webdav

Sun, 08 May 2022 19:31:38 +0200

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Sun, 08 May 2022 19:31:38 +0200
branch
webdav
changeset 347
b6d71e504294
parent 346
784b24381bed
child 348
bdd31584141f

update etag when a postgresql file is updated

src/server/plugins/postgresql/vfs.c file | annotate | diff | comparison | revisions
--- a/src/server/plugins/postgresql/vfs.c	Sun May 08 19:29:27 2022 +0200
+++ b/src/server/plugins/postgresql/vfs.c	Sun May 08 19:31:38 2022 +0200
@@ -134,7 +134,7 @@
 // Update resource metadata
 // params: $1: resource_id
 //         $2: contentlength
-static const char *sql_update_resource = "update Resource set contentlength = $2, lastmodified = now() where resource_id = $1;";
+static const char *sql_update_resource = "update Resource set contentlength = $2, lastmodified = now(), etag = gen_random_uuid() where resource_id = $1;";
 
 // Delete a resource
 // params: $1: resource_id

mercurial