mirror of
https://github.com/willnorris/imageproxy.git
synced 2025-01-20 22:53:00 -05:00
fixed tcp_mem resource leak when sending 304
This commit is contained in:
parent
2ad861f4b0
commit
74c16f575e
1 changed files with 2 additions and 1 deletions
|
@ -315,12 +315,13 @@ func (t *TransformingTransport) RoundTrip(req *http.Request) (*http.Response, er
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
defer resp.Body.Close()
|
||||||
|
|
||||||
if should304(req, resp) {
|
if should304(req, resp) {
|
||||||
// bare 304 response, full response will be used from cache
|
// bare 304 response, full response will be used from cache
|
||||||
return &http.Response{StatusCode: http.StatusNotModified}, nil
|
return &http.Response{StatusCode: http.StatusNotModified}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
defer resp.Body.Close()
|
|
||||||
b, err := ioutil.ReadAll(resp.Body)
|
b, err := ioutil.ReadAll(resp.Body)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
Loading…
Add table
Reference in a new issue