Example usage for Java org.springframework.web.cors CorsConfiguration fields, constructors, methods, implement or subclass
The text is from its open source code.
CorsConfiguration() Construct a new CorsConfiguration instance with no cross-origin requests allowed for any origin by default. |
void | addAllowedHeader(String allowedHeader) Add an actual request header to allow. |
void | addAllowedMethod(HttpMethod method) Add an HTTP method to allow. |
void | addAllowedMethod(String method) Add an HTTP method to allow. |
void | addAllowedOrigin(String origin) Add an origin to allow. |
void | addExposedHeader(String exposedHeader) Add a response header to expose. |
CorsConfiguration | applyPermitDefaultValues() By default a newly created CorsConfiguration does not permit any cross-origin requests and must be configured explicitly to indicate what should be allowed. |
List | checkHeaders(@Nullable List Check the supplied request headers (or the headers listed in the Access-Control-Request-Headers of a pre-flight request) against the configured allowed headers. |
List | checkHttpMethod(@Nullable HttpMethod requestMethod) Check the HTTP request method (or the method from the Access-Control-Request-Method header on a pre-flight request) against the configured allowed methods. |
String | checkOrigin(@Nullable String requestOrigin) Check the origin of the request against the configured allowed origins. |
CorsConfiguration | combine(@Nullable CorsConfiguration other) Combine the non-null properties of the supplied CorsConfiguration with this one. |
Boolean | getAllowCredentials() Return the configured allowCredentials flag, or null if none. |
List | getExposedHeaders() Return the configured response headers to expose, or null if none. |
Long | getMaxAge() Return the configured maxAge value, or null if none. |
void | setAllowCredentials(@Nullable Boolean allowCredentials) Whether user credentials are supported. |
void | setAllowedHeaders(@Nullable List Set the list of headers that a pre-flight request can list as allowed for use during an actual request. |
void | setAllowedMethods(@Nullable List Set the HTTP methods to allow, e.g. |
void | setAllowedOrigins(@Nullable List Set the origins to allow, e.g. |
void | setMaxAge(Duration maxAge) Configure how long, as a duration, the response from a pre-flight request can be cached by clients. |
void | setMaxAge(@Nullable Long maxAge) Configure how long, in seconds, the response from a pre-flight request can be cached by clients. |