mirror of
https://github.com/rclone/rclone
synced 2024-12-01 10:31:57 +01:00
webdav: workarounds for biz.mail.ru
* Add "Depth: 1" on read metadata PROPFIND call * Accept 406 to mean directory already exists
This commit is contained in:
parent
b07e51cf73
commit
d85b9bc9d6
@ -179,6 +179,9 @@ func (f *Fs) readMetaDataForPath(path string) (info *api.Prop, err error) {
|
|||||||
opts := rest.Opts{
|
opts := rest.Opts{
|
||||||
Method: "PROPFIND",
|
Method: "PROPFIND",
|
||||||
Path: f.filePath(path),
|
Path: f.filePath(path),
|
||||||
|
ExtraHeaders: map[string]string{
|
||||||
|
"Depth": "1",
|
||||||
|
},
|
||||||
}
|
}
|
||||||
var result api.Multistatus
|
var result api.Multistatus
|
||||||
var resp *http.Response
|
var resp *http.Response
|
||||||
@ -563,7 +566,7 @@ func (f *Fs) mkdir(dirPath string) error {
|
|||||||
})
|
})
|
||||||
if apiErr, ok := err.(*api.Error); ok {
|
if apiErr, ok := err.(*api.Error); ok {
|
||||||
// already exists
|
// already exists
|
||||||
if apiErr.StatusCode == http.StatusMethodNotAllowed {
|
if apiErr.StatusCode == http.StatusMethodNotAllowed || apiErr.StatusCode == http.StatusNotAcceptable {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
// parent does not exists
|
// parent does not exists
|
||||||
|
Loading…
Reference in New Issue
Block a user