Details
-
Bug
-
Resolution: Won't Do
-
Neutral
-
None
-
5.4.6
-
None
-
None
Description
To reproduce:
- Set /server/filters/contentType@validateContentType=true
- Request an image with a wrong extension (https://demo.magnolia-cms.com/.imaging/mte/travel-demo-theme/1366/dam/tours/flickr-swiss-trails-ed-coyle-3797048134_1f4a930f48_o.jpg/jcr:content/flickr-swiss-trails-ed-coyle-3797048134_1f4a930f48_o.jpg.jpg2)
java.lang.IllegalStateException: Failure when attempting to set response header Content-Encoding: gzip info.magnolia.cms.util.RequestHeaderUtil.addAndVerifyHeader(RequestHeaderUtil.java:69) info.magnolia.module.cache.filter.GZipFilter.doFilter(GZipFilter.java:87)
The culprit is possible in info.magnolia.cms.filters.ContentTypeCheckingResponseWrapper#setContentType which calls sendError but the filter chain is not finished.
Possible solutions would be:
- to set only the error state but call the sendError later in content type filter? OR
- fix GZipFilter to not set the header when the response is committed
Checklists
Acceptance criteria