[PR #366] fix: timestamp format of getlastmodified in dav xml #6829

Closed
opened 2026-05-31 00:15:31 +03:00 by zhus · 0 comments
Owner

Original Pull Request: https://github.com/sigoden/dufs/pull/366

State: closed
Merged: Yes


RFC4918 (WebDAV) requires the getlastmodified property to be a date as returned in a Last-Modified header. It also specifically references the rfc1123-date ABNF definition (though confusingly, as defined in RFC 2616), which always ends in GMT.

Note that HTTP/1.1 clients must accept timestamps as Dufs currently generates them, but servers are not allowed to generate them, and thus by reference, WebDAV servers can't either.

Unfortunately, chrono doesn't have a to_rfc1123 (or to_rfc2616) function, but all the parts are available via format.

I discovered this via error messages produced by the DAVx5 Android App: dav4jvm : [at.bitfire.dav4jvm.HttpUtils] Couldn't parse HTTP date: Wed, 21 Feb 2024 21:03:42 +0000, ignoring

**Original Pull Request:** https://github.com/sigoden/dufs/pull/366 **State:** closed **Merged:** Yes --- [RFC4918 (WebDAV)](https://datatracker.ietf.org/doc/html/rfc4918#section-15.7) requires the `getlastmodified` property to be a date *as returned* in a `Last-Modified` header. It also specifically references the `rfc1123-date` ABNF definition (though confusingly, as defined in [RFC 2616](https://datatracker.ietf.org/doc/html/rfc2616#section-3.3.1)), which always ends in `GMT`. Note that HTTP/1.1 clients must accept timestamps as Dufs currently generates them, but servers are not allowed to generate them, and thus by reference, WebDAV servers can't either. Unfortunately, `chrono` doesn't have a `to_rfc1123` (or `to_rfc2616`) function, but all the parts are available via `format`. I discovered this via error messages produced by the DAVx5 Android App: `dav4jvm : [at.bitfire.dav4jvm.HttpUtils] Couldn't parse HTTP date: Wed, 21 Feb 2024 21:03:42 +0000, ignoring`
zhus added the pull-request label 2026-05-31 00:15:31 +03:00
zhus closed this issue 2026-05-31 00:15:31 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sigoden/dufs#6829