mirror of
https://github.com/imgproxy/imgproxy.git
synced 2025-10-09 19:52:30 +02:00
Log response even if raw streaming failed
This commit is contained in:
@@ -129,9 +129,7 @@ func streamOriginImage(ctx context.Context, reqID string, r *http.Request, rw ht
|
||||
buf := streamBufPool.Get().(*[]byte)
|
||||
defer streamBufPool.Put(buf)
|
||||
|
||||
if _, err := io.CopyBuffer(rw, res.Body, *buf); err != nil {
|
||||
panic(http.ErrAbortHandler)
|
||||
}
|
||||
_, copyerr := io.CopyBuffer(rw, res.Body, *buf)
|
||||
|
||||
router.LogResponse(
|
||||
reqID, r, res.StatusCode, nil,
|
||||
@@ -140,4 +138,8 @@ func streamOriginImage(ctx context.Context, reqID string, r *http.Request, rw ht
|
||||
"processing_options": po,
|
||||
},
|
||||
)
|
||||
|
||||
if copyerr != nil {
|
||||
panic(http.ErrAbortHandler)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user