by default) in order to add the relevant CORS response headers (like `Access-Control-Allow-Origin`)
based on the CORS configuration you have provided.
[NOTE]
====
Be aware that cookies are not allowed by default to avoid increasing the surface attack of
the web application (for example via exposing sensitive user-specific information like
CSRF tokens). Set `allowedCredentials` property to `true` in order to allow them.
====
[NOTE]
====
Since CORS requests are automatically dispatched, you *do not need* to change the
@ -151,7 +158,8 @@ public class WebConfig extends WebMvcConfigurerAdapter {
@@ -151,7 +158,8 @@ public class WebConfig extends WebMvcConfigurerAdapter {
.allowedMethods("PUT", "DELETE")
.allowedHeaders("header1", "header2", "header3")
.exposedHeaders("header1", "header2")
.allowCredentials(false).maxAge(3600);
.allowCredentials(true)
.maxAge(3600);
}
}
----
@ -180,7 +188,7 @@ It is also possible to declare several CORS mappings with customized properties:
@@ -180,7 +188,7 @@ It is also possible to declare several CORS mappings with customized properties: