copyurl: honor --no-check-certificate

This commit is contained in:
Stefan Breunig
2019-03-08 21:33:22 +01:00
committed by Nick Craig-Wood
parent 0c60c00187
commit 72721f4c8d
3 changed files with 34 additions and 7 deletions

View File

@@ -8,7 +8,6 @@ import (
"fmt"
"io"
"io/ioutil"
"net/http"
"path"
"path/filepath"
"sort"
@@ -21,6 +20,7 @@ import (
"github.com/ncw/rclone/fs"
"github.com/ncw/rclone/fs/accounting"
"github.com/ncw/rclone/fs/fserrors"
"github.com/ncw/rclone/fs/fshttp"
"github.com/ncw/rclone/fs/hash"
"github.com/ncw/rclone/fs/march"
"github.com/ncw/rclone/fs/object"
@@ -1411,7 +1411,9 @@ func RcatSize(fdst fs.Fs, dstFileName string, in io.ReadCloser, size int64, modT
// CopyURL copies the data from the url to (fdst, dstFileName)
func CopyURL(fdst fs.Fs, dstFileName string, url string) (dst fs.Object, err error) {
resp, err := http.Get(url)
client := fshttp.NewClient(fs.Config)
resp, err := client.Get(url)
if err != nil {
return nil, err
}