diff options
| author | Chris Lu <chris.lu@gmail.com> | 2020-11-30 02:45:00 -0800 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2020-11-30 02:45:00 -0800 |
| commit | 141ce67c097565d085cf1ffaefd6aeb9e9e7db77 (patch) | |
| tree | 600fc2de40f58429e86d9ea2cc8a940a9122fbab /weed/util/http_util.go | |
| parent | 0e99531dbf51fdb087794e548c46a64e4aa8c9ba (diff) | |
| download | seaweedfs-141ce67c097565d085cf1ffaefd6aeb9e9e7db77.tar.xz seaweedfs-141ce67c097565d085cf1ffaefd6aeb9e9e7db77.zip | |
close http request body
Diffstat (limited to 'weed/util/http_util.go')
| -rw-r--r-- | weed/util/http_util.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/weed/util/http_util.go b/weed/util/http_util.go index 7851d8293..2cd69b01b 100644 --- a/weed/util/http_util.go +++ b/weed/util/http_util.go @@ -374,3 +374,8 @@ func CloseResponse(resp *http.Response) { io.Copy(ioutil.Discard, resp.Body) resp.Body.Close() } + +func CloseRequest(req *http.Request) { + io.Copy(ioutil.Discard, req.Body) + req.Body.Close() +} |
