etags attempt #2
All checks were successful
Deploy App / docker (ubuntu-latest, 2.44.0, 17, 3.8.5) (push) Successful in 1m52s

This commit is contained in:
Lee
2024-04-19 21:00:08 +01:00
parent 46d4a53b11
commit 1cfcce4806
11 changed files with 31 additions and 21 deletions

View File

@ -6,9 +6,11 @@ import lombok.NonNull;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;
import org.springframework.web.filter.ShallowEtagHeaderFilter;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@ -28,6 +30,14 @@ public class Config {
INSTANCE = this;
}
@Bean
public FilterRegistrationBean<ShallowEtagHeaderFilter> shallowEtagHeaderFilter() {
FilterRegistrationBean<ShallowEtagHeaderFilter> filterRegistrationBean = new FilterRegistrationBean<>(new ShallowEtagHeaderFilter());
filterRegistrationBean.addUrlPatterns("/*");
filterRegistrationBean.setName("etagFilter");
return filterRegistrationBean;
}
@Bean
public WebMvcConfigurer configureCors() {
return new WebMvcConfigurer() {