2021-02-04 21:11:09 +00:00
|
|
|
package edu.kit.typicalc;
|
|
|
|
|
|
|
|
import org.apache.tomcat.util.http.Rfc6265CookieProcessor;
|
|
|
|
import org.apache.tomcat.util.http.SameSiteCookies;
|
|
|
|
import org.springframework.boot.web.embedded.tomcat.TomcatContextCustomizer;
|
|
|
|
import org.springframework.context.annotation.Bean;
|
|
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
|
|
|
|
2021-02-06 14:57:53 +00:00
|
|
|
/**
|
|
|
|
* This class configures some server properties related to HTTP.
|
|
|
|
*/
|
2021-02-04 21:11:09 +00:00
|
|
|
@Configuration
|
|
|
|
public class TypicalcConfiguration implements WebMvcConfigurer {
|
|
|
|
@Bean
|
|
|
|
public TomcatContextCustomizer sameSiteCookiesConfig() {
|
|
|
|
return context -> {
|
2021-02-06 14:57:53 +00:00
|
|
|
Rfc6265CookieProcessor cookieProcessor = new Rfc6265CookieProcessor();
|
2021-02-04 21:11:09 +00:00
|
|
|
cookieProcessor.setSameSiteCookies(SameSiteCookies.STRICT.getValue());
|
|
|
|
context.setCookieProcessor(cookieProcessor);
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|