CorsConfiguration instance for a given
URL path pattern.
CorsConfiguration, CorsRegistry
| Modifier and Type | Field and Description |
|---|---|
| private CorsConfiguration | |
| private final String |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public CorsRegistration | allowCredentials(boolean allowCredentials)
Whether the browser should send credentials, such as cookies along with cross domain requests, to the annotated endpoint. |
| public CorsRegistration | allowedHeaders(String... headers)
Set the list of headers that a pre-flight request can list as allowed for use during an actual request. |
| public CorsRegistration | allowedMethods(String... methods)
Set the HTTP methods to allow, e.g. |
| public CorsRegistration | allowedOriginPatterns(String... patterns)
Alternative to |
| public CorsRegistration | allowedOrigins(String... origins)
Set the origins for which cross-origin requests are allowed from a browser. |
| public CorsRegistration | |
| public CorsRegistration | combine(CorsConfiguration
the configuration to apply other)Apply the given |
| public CorsRegistration | exposedHeaders(String... headers)
Set the list of response headers that an actual response might have and can be exposed. |
| protected CorsConfiguration | |
| protected String | |
| public CorsRegistration | maxAge(long maxAge)
Configure how long in seconds the response from a pre-flight request can be cached by clients. |
| config | back to summary |
|---|---|
| private CorsConfiguration config | |
| pathPattern | back to summary |
|---|---|
| private final String pathPattern | |
| CorsRegistration | back to summary |
|---|---|
| public CorsRegistration(String pathPattern) | |
| allowCredentials | back to summary |
|---|---|
| public CorsRegistration allowCredentials(boolean allowCredentials) Whether the browser should send credentials, such as cookies along with
cross domain requests, to the annotated endpoint. The configured value is
set on the Note Be aware that this option establishes a high level of trust with the configured domains and also increases the surface attack of the web application by exposing sensitive user-specific information such as cookies and CSRF tokens. By default this is not set in which case the
| |
| allowedHeaders | back to summary |
|---|---|
| public CorsRegistration allowedHeaders(String... headers) Set the list of headers that a pre-flight request can list as allowed
for use during an actual request. The special value Please, see By default all headers are allowed. | |
| allowedMethods | back to summary |
|---|---|
| public CorsRegistration allowedMethods(String... methods) Set the HTTP methods to allow, e.g. Please, see | |
| allowedOriginPatterns | back to summary |
|---|---|
| public CorsRegistration allowedOriginPatterns(String... patterns) Alternative to By default this is not set.
| |
| allowedOrigins | back to summary |
|---|---|
| public CorsRegistration allowedOrigins(String... origins) Set the origins for which cross-origin requests are allowed from a browser.
Please, refer to By default, all origins are allowed, but if
| |
| allowPrivateNetwork | back to summary |
|---|---|
| public CorsRegistration allowPrivateNetwork(boolean allowPrivateNetwork) Whether private network access is supported. Please, see By default this is not set (i.e. private network access is not supported).
| |
| combine | back to summary |
|---|---|
| public CorsRegistration combine(CorsConfiguration other) Apply the given
| |
| exposedHeaders | back to summary |
|---|---|
| public CorsRegistration exposedHeaders(String... headers) Set the list of response headers that an actual response might have and
can be exposed. The special value Please, see By default this is not set. | |
| getCorsConfiguration | back to summary |
|---|---|
| protected CorsConfiguration getCorsConfiguration() | |
| getPathPattern | back to summary |
|---|---|
| protected String getPathPattern() | |
| maxAge | back to summary |
|---|---|
| public CorsRegistration maxAge(long maxAge) Configure how long in seconds the response from a pre-flight request can be cached by clients. By default this is set to 1800 seconds (30 minutes). | |