mirror of
https://gitlab.kit.edu/uskyk/typicalc.git
synced 2024-11-08 18:30:42 +00:00
Set SameSite=Strict on cookies
This commit is contained in:
parent
af985f6e86
commit
7494407480
21
src/main/java/edu/kit/typicalc/TypicalcConfiguration.java
Normal file
21
src/main/java/edu/kit/typicalc/TypicalcConfiguration.java
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
public class TypicalcConfiguration implements WebMvcConfigurer {
|
||||||
|
@Bean
|
||||||
|
public TomcatContextCustomizer sameSiteCookiesConfig() {
|
||||||
|
return context -> {
|
||||||
|
final Rfc6265CookieProcessor cookieProcessor = new Rfc6265CookieProcessor();
|
||||||
|
cookieProcessor.setSameSiteCookies(SameSiteCookies.STRICT.getValue());
|
||||||
|
context.setCookieProcessor(cookieProcessor);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user