From b7d20480328a8f867e964bc10f7c0405420aad7e Mon Sep 17 00:00:00 2001 From: Rodrigo Date: Mon, 30 Apr 2018 14:15:24 +0200 Subject: [PATCH] WebDAV: Ignore Reason-Phrase in status line #2281 --- backend/webdav/api/types.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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])