Affects: Spring 5.2.4.RELEASE
Hello,
Despite #22797 and #23775, the ShallowETagHeaderFilter keeps overwriting ETag and Content-Length headers.
Here is a repository with unit tests that feature this issue: https://github.com/mickaeltr/Spring-ShallowEtagHeaderFilter-issue/
@GetMapping("/stream")
public ResponseEntity<InputStreamResource> stream(HttpServletRequest request) {
// Let's say I have a big input stream for which I want to:
// - provide the Content-Length and ETag (to avoid a heavy calculation by ShallowEtagHeaderFilter)
// - allow caching through If-None-Match
return ResponseEntity.ok()
.contentType(MediaType.TEXT_PLAIN)
.eTag("demo") // -> overriden by ShallowETagHeaderFilter
.contentLength(123) // -> overriden by ShallowETagHeaderFilter
.cacheControl(CacheControl.maxAge(1, TimeUnit.HOURS))
.body(new InputStreamResource(new ByteArrayInputStream("demo".getBytes())));
}
Thanks
Affects: Spring 5.2.4.RELEASE
Hello,
Despite #22797 and #23775, the ShallowETagHeaderFilter keeps overwriting ETag and Content-Length headers.
Here is a repository with unit tests that feature this issue: https://github.com/mickaeltr/Spring-ShallowEtagHeaderFilter-issue/
Thanks