Skip to content

ShallowETagHeaderFilter overwrites ETag #23775

@cdalexndr

Description

@cdalexndr

Affects: 5.2.0.RELEASE

Inside a @Controller I set the ETag and Cache-control header:

String etag = ...
if (webRequest.checkNotModified( etag ))
    return null;
response.setHeader( HttpHeaders.CACHE_CONTROL, CacheControl.maxAge( 30, TimeUnit.DAYS ).cachePublic().getHeaderValue() );

ShallowETagHeaderFilter overwrites ETag because isEligibleForEtag method returns true:

String cacheControl = response.getHeader(HttpHeaders.CACHE_CONTROL);
return (cacheControl == null || !cacheControl.contains(DIRECTIVE_NO_STORE));

ShallowEtagHeaderFilter should first check if an ETag is already set and skip it.

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)status: backportedAn issue that has been backported to maintenance branchestype: bugA general bug

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions