]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
mod_dav: Document DavHonorMtimeHeader directive
authorRich Bowen <rbowen@apache.org>
Wed, 20 May 2026 20:02:21 +0000 (20:02 +0000)
committerRich Bowen <rbowen@apache.org>
Wed, 20 May 2026 20:02:21 +0000 (20:02 +0000)
When enabled, allows WebDAV clients to set resource modification
times via the X-OC-Mtime request header on PUT and MKCOL requests.

Resolves: bz#70054

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1934445 13f79535-47bb-0310-9956-ffa450edef68

docs/manual/mod/mod_dav.xml

index 7f95512abed48db4a64dd7b1e91a874519c9bac3..a94a246ca08a260d3dda7da65bd556a5f354369f 100644 (file)
@@ -286,6 +286,51 @@ a DAV resource</description>
 </usage>
 </directivesynopsis>
 
+<directivesynopsis>
+<name>DavHonorMtimeHeader</name>
+<description>Allow clients to set resource modification times via the
+X-OC-Mtime request header</description>
+<syntax>DavHonorMtimeHeader on|off</syntax>
+<default>DavHonorMtimeHeader off</default>
+<contextlist><context>directory</context></contextlist>
+
+<usage>
+    <p>The <directive>DavHonorMtimeHeader</directive> directive controls
+    whether <module>mod_dav</module> will honor the
+    <code>X-OC-Mtime</code> request header when processing
+    <code>PUT</code> and <code>MKCOL</code> requests. This header
+    is used by some WebDAV sync clients to preserve the
+    original modification time of uploaded files.</p>
+
+    <p>When enabled, if a client sends a <code>PUT</code> or
+    <code>MKCOL</code> request with an <code>X-OC-Mtime</code>
+    header, the server will set the resource's modification time to
+    the value specified in that header. The header value must be a
+    Unix timestamp (seconds since epoch), expressed as a decimal
+    integer.</p>
+
+    <p>If the header is present but malformed (contains non-digit
+    characters), the server will respond with a 400 Bad Request
+    error.</p>
+
+    <note type="warning">
+    <p>Enabling this directive allows clients to manipulate file
+    modification times on the server. Only enable it in locations
+    where clients are trusted, and always protect access with
+    authentication.</p>
+    </note>
+
+    <example><title>Example</title>
+    <highlight language="config">
+&lt;Directory "/var/www/dav/sync"&gt;
+    Dav On
+    DavHonorMtimeHeader on
+&lt;/Directory&gt;
+    </highlight>
+    </example>
+</usage>
+</directivesynopsis>
+
 </modulesynopsis>