aboutsummaryrefslogtreecommitdiff
path: root/weed/command/download.go
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2024-08-10 10:01:57 -0700
committerchrislu <chris.lu@gmail.com>2024-08-10 10:01:57 -0700
commit7438648d1cfacd5ca570dd029d1bdb5fd271bd70 (patch)
treecf12b49473be0373cb03d83470ddc75708454171 /weed/command/download.go
parent49893267e978cc3fda00dc991e00099742fb5a9d (diff)
parent63c707f9c1b4dc469ec39c446563c324ce4ccb6f (diff)
downloadseaweedfs-7438648d1cfacd5ca570dd029d1bdb5fd271bd70.tar.xz
seaweedfs-7438648d1cfacd5ca570dd029d1bdb5fd271bd70.zip
Merge branch 'master' into mq
Diffstat (limited to 'weed/command/download.go')
-rw-r--r--weed/command/download.go11
1 files changed, 6 insertions, 5 deletions
diff --git a/weed/command/download.go b/weed/command/download.go
index 060be9f14..1b7098824 100644
--- a/weed/command/download.go
+++ b/weed/command/download.go
@@ -15,6 +15,7 @@ import (
"github.com/seaweedfs/seaweedfs/weed/pb"
"github.com/seaweedfs/seaweedfs/weed/security"
"github.com/seaweedfs/seaweedfs/weed/util"
+ util_http "github.com/seaweedfs/seaweedfs/weed/util/http"
)
var (
@@ -47,7 +48,7 @@ var cmdDownload = &Command{
}
func runDownload(cmd *Command, args []string) bool {
- util.LoadConfiguration("security", false)
+ util.LoadSecurityConfiguration()
grpcDialOption := security.LoadClientTLS(util.GetViper(), "grpc.client")
for _, fid := range args {
@@ -63,11 +64,11 @@ func downloadToFile(masterFn operation.GetMasterFn, grpcDialOption grpc.DialOpti
if lookupError != nil {
return lookupError
}
- filename, _, rc, err := util.DownloadFile(fileUrl, jwt)
+ filename, _, rc, err := util_http.DownloadFile(fileUrl, jwt)
if err != nil {
return err
}
- defer util.CloseResponse(rc)
+ defer util_http.CloseResponse(rc)
if filename == "" {
filename = fileId
}
@@ -116,10 +117,10 @@ func fetchContent(masterFn operation.GetMasterFn, grpcDialOption grpc.DialOption
return "", nil, lookupError
}
var rc *http.Response
- if filename, _, rc, e = util.DownloadFile(fileUrl, jwt); e != nil {
+ if filename, _, rc, e = util_http.DownloadFile(fileUrl, jwt); e != nil {
return "", nil, e
}
- defer util.CloseResponse(rc)
+ defer util_http.CloseResponse(rc)
content, e = io.ReadAll(rc.Body)
return
}