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: parse time in alternate format for mydrive.ch - fixes #1952

Nick Craig-Woodef89f1f1a795
diff --git a/webdav/api/types.go b/webdav/api/types.go
index d7a69b273..d9bd624d2 100644
--- a/webdav/api/types.go
+++ b/webdav/api/types.go
@@ -11,6 +11,8 @@ import (
const (
// Wed, 27 Sep 2017 14:28:34 GMT
timeFormat = time.RFC1123
+ // Fri, 05 Jan 2018 14:14:38 +0000 (as used by mydrive.ch)
+ timeFormatZ = time.RFC1123Z
)
// Multistatus contains responses returned from an HTTP 207 return code
@@ -140,7 +142,10 @@ func (t *Time) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
}
newT, err := time.Parse(timeFormat, v)
if err != nil {
- return err
+ newT, err = time.Parse(timeFormatZ, v)
+ if err != nil {
+ return err
+ }
}
*t = Time(newT)
return nil