diff options
| author | Chris Lu <chris.lu@gmail.com> | 2018-09-21 01:54:29 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2018-09-21 01:54:29 -0700 |
| commit | a6cfaba018984ba17b9eab802db909bac644b67b (patch) | |
| tree | 71d00727c28ac5cc527412306db3b98763f2eb68 /weed/util/http_util.go | |
| parent | a8cd7df44ae5d3bea4b0c9ce3d3ab71c7b3cc60c (diff) | |
| download | seaweedfs-a6cfaba018984ba17b9eab802db909bac644b67b.tar.xz seaweedfs-a6cfaba018984ba17b9eab802db909bac644b67b.zip | |
able to sync the changes
Diffstat (limited to 'weed/util/http_util.go')
| -rw-r--r-- | weed/util/http_util.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/weed/util/http_util.go b/weed/util/http_util.go index 56c294f0d..7ae5713bb 100644 --- a/weed/util/http_util.go +++ b/weed/util/http_util.go @@ -155,11 +155,12 @@ func GetUrlStream(url string, values url.Values, readFn func(io.Reader) error) e return readFn(r.Body) } -func DownloadUrl(fileUrl string) (filename string, rc io.ReadCloser, e error) { +func DownloadFile(fileUrl string) (filename string, header http.Header, rc io.ReadCloser, e error) { response, err := client.Get(fileUrl) if err != nil { - return "", nil, err + return "", nil, nil, err } + header = response.Header contentDisposition := response.Header["Content-Disposition"] if len(contentDisposition) > 0 { idx := strings.Index(contentDisposition[0], "filename=") |
