mirror of
https://github.com/willnorris/imageproxy.git
synced 2025-01-06 22:40:34 -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
|
||||
}
|
||||
|
||||
defer resp.Body.Close()
|
||||
|
||||
if should304(req, resp) {
|
||||
// bare 304 response, full response will be used from cache
|
||||
return &http.Response{StatusCode: http.StatusNotModified}, nil
|
||||
}
|
||||
|
||||
defer resp.Body.Close()
|
||||
b, err := ioutil.ReadAll(resp.Body)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
Loading…
Reference in a new issue