You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2020/04/28 22:10:26 UTC

[Bug 64386] New: WebdavServlet does not send "getlastmodified" property for resource collections

https://bz.apache.org/bugzilla/show_bug.cgi?id=64386

            Bug ID: 64386
           Summary: WebdavServlet does not send "getlastmodified" property
                    for resource collections
           Product: Tomcat 10
           Version: 10.0.0-M4
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Catalina
          Assignee: dev@tomcat.apache.org
          Reporter: michaelo@apache.org
  Target Milestone: ------

The property is only set for resources (files), not for resource collections
(directories) for no reason. Various DAV clients show weird values like
1899-01-01 or something else.

A simple patch makes it work:
diff --git a/java/org/apache/catalina/servlets/WebdavServlet.java
b/java/org/apache/catalina/servlets/WebdavServlet.java
index 371de111c9..228bab0032 100644
--- a/java/org/apache/catalina/servlets/WebdavServlet.java
+++ b/java/org/apache/catalina/servlets/WebdavServlet.java
@@ -2087,6 +2082,8 @@ public class WebdavServlet extends DefaultServlet {
                     generatedXML.writeElement("D", "resourcetype",
XMLWriter.NO_CONTENT);
                 }
             } else {
+                generatedXML.writeProperty("D", "getlastmodified",
+                        FastHttpDateFormat.formatDate(lastModified));
                 generatedXML.writeElement("D", "resourcetype",
XMLWriter.OPENING);
                 generatedXML.writeElement("D", "collection",
XMLWriter.NO_CONTENT);
                 generatedXML.writeElement("D", "resourcetype",
XMLWriter.CLOSING);

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 64386] WebdavServlet does not send "getlastmodified" property for resource collections

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=64386

Michael Osipov <mi...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #1 from Michael Osipov <mi...@apache.org> ---
Fixed in:
- master for 10.0.0-M5 and onwards
- 9.0.x  for 9.0.35 and onwards
- 8.5.x for 8.5.55 and onwards
- 7.0.x for 7.0.104 and onwards

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org