mirror of
https://github.com/restic/restic.git
synced 2025-08-23 18:07:51 +00:00
Merge pull request #4618 from MichaelEischer/workaround-rclone-list-errors
rclone: Workaround for incorrect "not found" errors while listing files
This commit is contained in:
@@ -328,8 +328,13 @@ func (b *Backend) List(ctx context.Context, t backend.FileType, fn func(backend.
|
||||
}
|
||||
|
||||
if resp.StatusCode == http.StatusNotFound {
|
||||
// ignore missing directories
|
||||
return nil
|
||||
if !strings.HasPrefix(resp.Header.Get("Server"), "rclone/") {
|
||||
// ignore missing directories, unless the server is rclone. rclone
|
||||
// already ignores missing directories, but misuses "not found" to
|
||||
// report certain internal errors, see
|
||||
// https://github.com/rclone/rclone/pull/7550 for details.
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
if resp.StatusCode != http.StatusOK {
|
||||
|
Reference in New Issue
Block a user