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: Ignore Reason-Phrase in status line #2281

Rodrigob7d20480328a
diff --git a/backend/webdav/api/types.go b/backend/webdav/api/types.go
index 845cd64a2..284b145fb 100644
--- a/backend/webdav/api/types.go
+++ b/backend/webdav/api/types.go
@@ -65,8 +65,8 @@ type Prop struct {
Modified Time `xml:"DAV: prop>getlastmodified,omitempty"`
}
-// Parse a status of the form "HTTP/1.1 200 OK",
-var parseStatus = regexp.MustCompile(`^HTTP/[0-9.]+\s+(\d+)\s+(.*)$`)
+// Parse a status of the form "HTTP/1.1 200 OK" or "HTTP/1.1 200"
+var parseStatus = regexp.MustCompile(`^HTTP/[0-9.]+\s+(\d+)`)
// StatusOK examines the Status and returns an OK flag
func (p *Prop) StatusOK() bool {
@@ -75,7 +75,7 @@ func (p *Prop) StatusOK() bool {
return true
}
match := parseStatus.FindStringSubmatch(p.Status[0])
- if len(match) < 3 {
+ if len(match) < 2 {
return false
}
code, err := strconv.Atoi(match[1])