Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

webdav: Add another time format to fix #2574

Nick Craig-Wooda25875170bc1
diff --git a/backend/webdav/api/types.go b/backend/webdav/api/types.go
index b92cc97b9..983825418 100644
--- a/backend/webdav/api/types.go
+++ b/backend/webdav/api/types.go
@@ -12,6 +12,9 @@ import (
const (
// Wed, 27 Sep 2017 14:28:34 GMT
timeFormat = time.RFC1123
+ // The same as time.RFC1123 with optional leading zeros on the date
+ // see https://github.com/ncw/rclone/issues/2574
+ noZerosRFC1123 = "Mon, _2 Jan 2006 15:04:05 MST"
)
// Multistatus contains responses returned from an HTTP 207 return code
@@ -138,9 +141,10 @@ func (t *Time) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
// Possible time formats to parse the time with
var timeFormats = []string{
- timeFormat, // Wed, 27 Sep 2017 14:28:34 GMT (as per RFC)
- time.RFC1123Z, // Fri, 05 Jan 2018 14:14:38 +0000 (as used by mydrive.ch)
- time.UnixDate, // Wed May 17 15:31:58 UTC 2017 (as used in an internal server)
+ timeFormat, // Wed, 27 Sep 2017 14:28:34 GMT (as per RFC)
+ time.RFC1123Z, // Fri, 05 Jan 2018 14:14:38 +0000 (as used by mydrive.ch)
+ time.UnixDate, // Wed May 17 15:31:58 UTC 2017 (as used in an internal server)
+ noZerosRFC1123, // Fri, 7 Sep 2018 08:49:58 GMT (as used by server in #2574)
}
// UnmarshalXML turns XML into a Time