public class CorsOriginConfiguration extends Object
Modifier and Type | Field and Description |
---|---|
static List<String> |
ANY
Constant to represent any value.
|
static List<HttpMethod> |
ANY_METHOD
Constant to represent any method.
|
Constructor and Description |
---|
CorsOriginConfiguration() |
Modifier and Type | Method and Description |
---|---|
List<String> |
getAllowedHeaders() |
List<HttpMethod> |
getAllowedMethods() |
List<String> |
getAllowedOrigins() |
Optional<String> |
getAllowedOriginsRegex() |
List<String> |
getExposedHeaders() |
Long |
getMaxAge() |
boolean |
isAllowCredentials() |
void |
setAllowCredentials(boolean allowCredentials)
Sets whether to allow credentials.
|
void |
setAllowedHeaders(List<String> allowedHeaders)
Sets the allowed headers.
|
void |
setAllowedMethods(List<HttpMethod> allowedMethods)
Sets the allowed methods.
|
void |
setAllowedOrigins(List<String> allowedOrigins)
Sets the allowed origins.
|
void |
setAllowedOriginsRegex(String allowedOriginsRegex)
Sets a regular expression for matching Allowed Origins.
|
void |
setExposedHeaders(List<String> exposedHeaders)
Sets the exposed headers.
|
void |
setMaxAge(Long maxAge)
Sets the max age.
|
public static final List<HttpMethod> ANY_METHOD
public void setAllowedOrigins(@Nullable List<String> allowedOrigins)
allowedOrigins
- The allow origins@NonNull public Optional<String> getAllowedOriginsRegex()
public void setAllowedOriginsRegex(String allowedOriginsRegex)
allowedOriginsRegex
- a regular expression for matching Allowed Origins.public List<HttpMethod> getAllowedMethods()
public void setAllowedMethods(@Nullable List<HttpMethod> allowedMethods)
allowedMethods
- The allowed methodspublic void setAllowedHeaders(@Nullable List<String> allowedHeaders)
allowedHeaders
- The allowed headerspublic void setExposedHeaders(@Nullable List<String> exposedHeaders)
exposedHeaders
- The exposed headerspublic boolean isAllowCredentials()
public void setAllowCredentials(boolean allowCredentials)
allowCredentials
- The credentialspublic Long getMaxAge()