aboutsummaryrefslogtreecommitdiff
path: root/weed/util/http_util.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2020-09-09 03:53:09 -0700
committerChris Lu <chris.lu@gmail.com>2020-09-09 03:53:09 -0700
commit4fc0bd1a8173e284ff919edb5214f5adf7a90f06 (patch)
tree4f6c6f634150ddbcbe992e131315cc0c121c4dcc /weed/util/http_util.go
parent5e13bc878ca63c72f71d1e93a9da44b3debc22df (diff)
downloadseaweedfs-4fc0bd1a8173e284ff919edb5214f5adf7a90f06.tar.xz
seaweedfs-4fc0bd1a8173e284ff919edb5214f5adf7a90f06.zip
return http response directly
Diffstat (limited to 'weed/util/http_util.go')
-rw-r--r--weed/util/http_util.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/weed/util/http_util.go b/weed/util/http_util.go
index 7cc64ea85..eef24b930 100644
--- a/weed/util/http_util.go
+++ b/weed/util/http_util.go
@@ -174,7 +174,7 @@ func GetUrlStream(url string, values url.Values, readFn func(io.Reader) error) e
return readFn(r.Body)
}
-func DownloadFile(fileUrl string) (filename string, header http.Header, rc io.ReadCloser, e error) {
+func DownloadFile(fileUrl string) (filename string, header http.Header, resp *http.Response, e error) {
response, err := client.Get(fileUrl)
if err != nil {
return "", nil, nil, err
@@ -188,7 +188,7 @@ func DownloadFile(fileUrl string) (filename string, header http.Header, rc io.Re
filename = strings.Trim(filename, "\"")
}
}
- rc = response.Body
+ resp = response
return
}