mirror of
https://github.com/rclone/rclone.git
synced 2025-01-11 08:49:37 +01:00
WebDAV: Ignore Reason-Phrase in status line #2281
This commit is contained in:
parent
3116249692
commit
b7d2048032
@ -65,8 +65,8 @@ type Prop struct {
|
|||||||
Modified Time `xml:"DAV: prop>getlastmodified,omitempty"`
|
Modified Time `xml:"DAV: prop>getlastmodified,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parse a status of the form "HTTP/1.1 200 OK",
|
// 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+)\s+(.*)$`)
|
var parseStatus = regexp.MustCompile(`^HTTP/[0-9.]+\s+(\d+)`)
|
||||||
|
|
||||||
// StatusOK examines the Status and returns an OK flag
|
// StatusOK examines the Status and returns an OK flag
|
||||||
func (p *Prop) StatusOK() bool {
|
func (p *Prop) StatusOK() bool {
|
||||||
@ -75,7 +75,7 @@ func (p *Prop) StatusOK() bool {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
match := parseStatus.FindStringSubmatch(p.Status[0])
|
match := parseStatus.FindStringSubmatch(p.Status[0])
|
||||||
if len(match) < 3 {
|
if len(match) < 2 {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
code, err := strconv.Atoi(match[1])
|
code, err := strconv.Atoi(match[1])
|
||||||
|
Loading…
Reference in New Issue
Block a user