Skip to content

Update docs on ShallowEtagHeaderFilter with regards to ASYNC dispatches #23958

@cdalexndr

Description

@cdalexndr

Affects: 5.2.0.RELEASE

Original issue: spring-projects/spring-boot#18931

Registering ShallowEtagHeaderFilter with default configuration breaks async web requests, causing timeouts:

    @Bean
    public Filter etagFilter() {
        return new ShallowEtagHeaderFilter();
    }

The correct configuration is:

@Bean
public FilterRegistrationBean<ShallowEtagHeaderFilter> etagFilter() {
    FilterRegistrationBean<ShallowEtagHeaderFilter> registration = new FilterRegistrationBean<>(new ShallowEtagHeaderFilter());
    registration.setDispatcherTypes(EnumSet.of(DispatcherType.REQUEST, DispatcherType.ASYNC));
    return registration;
}

Please update the documentation to include this configuration for async requests, or provide a way to automatically configure for async requests.

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: documentationA documentation task

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions