mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-12-17 17:51:20 +08:00
return http response directly
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user