mirror of
https://github.com/imgproxy/imgproxy.git
synced 2025-09-16 09:36:18 +02:00
Ignore http.ErrBodyNotAllowed error during streaming
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
## [Unreleased]
|
||||
### Fixed
|
||||
- Fix the `Vary` header value when `IMGPROXY_AUTO_JXL` or `IMGPROXY_ENFORCE_JXL` configs are set to `true`.
|
||||
- Fix connection break when the `raw` processing option is used and the response status code does not allow a response body (such as `304 Not Modified`).
|
||||
- Fix the `If-Modified-Since` request header handling when the `raw` processing option is used.
|
||||
- (pro) Fix generating thumbnails for VP9 videos with high bit depth.
|
||||
- (pro) Fix `IMGPROXY_CUSTOM_RESPONSE_HEADERS` and `IMGPROXY_RESPONSE_HEADERS_PASSTHROUGH` configs behavior when the `raw` processing option is used.
|
||||
|
@@ -127,6 +127,11 @@ func streamOriginImage(ctx context.Context, reqID string, r *http.Request, rw ht
|
||||
defer streamBufPool.Put(buf)
|
||||
|
||||
_, copyerr := io.CopyBuffer(rw, res.Body, *buf)
|
||||
if copyerr == http.ErrBodyNotAllowed {
|
||||
// We can hit this for some statuses like 304 Not Modified.
|
||||
// We can ignore this error.
|
||||
copyerr = nil
|
||||
}
|
||||
|
||||
router.LogResponse(
|
||||
reqID, r, res.StatusCode, nil,
|
||||
|
Reference in New Issue
Block a user