mirror of
https://github.com/restic/restic.git
synced 2025-03-16 00:00:05 +01:00
accept http urls without trailing slash
This commit is contained in:
parent
d41b3b0302
commit
197e97b0b7
1 changed files with 8 additions and 5 deletions
|
@ -151,14 +151,16 @@ func open(u string) (backend.Backend, error) {
|
|||
return local.Open(url.Path)
|
||||
}
|
||||
|
||||
if url.Scheme == "http" || url.Scheme == "https" {
|
||||
return rest.Open(url)
|
||||
}
|
||||
|
||||
if len(url.Path) < 1 {
|
||||
return nil, fmt.Errorf("unable to parse url %v", url)
|
||||
}
|
||||
|
||||
if url.Scheme == "s3" {
|
||||
return s3.Open(url.Host, url.Path[1:])
|
||||
} else if url.Scheme == "http" || url.Scheme == "https" {
|
||||
return rest.Open(url)
|
||||
}
|
||||
|
||||
args := []string{url.Host}
|
||||
|
@ -188,15 +190,16 @@ func create(u string) (backend.Backend, error) {
|
|||
return local.Create(url.Path)
|
||||
}
|
||||
|
||||
if url.Scheme == "http" || url.Scheme == "https" {
|
||||
return rest.Open(url)
|
||||
}
|
||||
|
||||
if len(url.Path) < 1 {
|
||||
return nil, fmt.Errorf("unable to parse url %v", url)
|
||||
}
|
||||
|
||||
if url.Scheme == "s3" {
|
||||
return s3.Open(url.Host, url.Path[1:])
|
||||
} else if url.Scheme == "http" || url.Scheme == "https" {
|
||||
|
||||
return rest.Open(url)
|
||||
}
|
||||
|
||||
args := []string{url.Host}
|
||||
|
|
Loading…
Add table
Reference in a new issue