public class CORSConfiguration extends Object
Constructor and Description |
---|
CORSConfiguration() |
Modifier and Type | Method and Description |
---|---|
boolean |
getAllowCredentials()
Get the value of Allow-Credentials.
|
List<String> |
getAllowHeaders()
Get a list of allowed headers.
|
List<String> |
getAllowMethods()
Get a list of allowed methods.
|
List<String> |
getAllowOrigin()
Get a list of allowed origins.
|
boolean |
getEnabled()
Get whether CORS has been enabled.
|
List<String> |
getExposeHeaders()
Get a list of exposed headers.
|
int |
getMaxAge()
Get the Max-Age header.
|
void |
setAllowCredentials(boolean allowCredentials)
Control whether Allow-Credentials should be displayed.
|
void |
setAllowHeaders(List<String> headers)
Set the allowed headers.
|
void |
setAllowMethods(List<String> methods)
Set the allowed methods.
|
void |
setAllowOrigin(List<String> origins)
Set the allowed origins.
|
void |
setEnabled(boolean enabled)
Enable or disable CORS.
|
void |
setExposeHeaders(List<String> headers)
Set the exposed headers.
|
void |
setMaxAge(int maxAge)
Set the Max-Age header.
|
public boolean getEnabled()
public void setEnabled(boolean enabled)
enabled
- true if CORS is enabled; false otherwisepublic List<String> getAllowOrigin()
public void setAllowOrigin(List<String> origins)
origins
- the originspublic List<String> getAllowMethods()
public void setAllowMethods(List<String> methods)
methods
- the methodspublic List<String> getAllowHeaders()
public void setAllowHeaders(List<String> headers)
headers
- the allowed headerspublic List<String> getExposeHeaders()
public void setExposeHeaders(List<String> headers)
headers
- the exposed headerspublic int getMaxAge()
public void setMaxAge(int maxAge)
maxAge
- the max agepublic boolean getAllowCredentials()
public void setAllowCredentials(boolean allowCredentials)
allowCredentials
- true if Allow-Credentials should be included; false otherwise