Java org.springframework.web.cors CorsConfiguration fields, constructors, methods, implement or subclass

Example usage for Java org.springframework.web.cors CorsConfiguration fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for org.springframework.web.cors CorsConfiguration.

The text is from its open source code.

Constructor

CorsConfiguration()
Construct a new CorsConfiguration instance with no cross-origin requests allowed for any origin by default.

Method

voidaddAllowedHeader(String allowedHeader)
Add an actual request header to allow.
voidaddAllowedMethod(HttpMethod method)
Add an HTTP method to allow.
voidaddAllowedMethod(String method)
Add an HTTP method to allow.
voidaddAllowedOrigin(String origin)
Add an origin to allow.
voidaddExposedHeader(String exposedHeader)
Add a response header to expose.
CorsConfigurationapplyPermitDefaultValues()
By default a newly created CorsConfiguration does not permit any cross-origin requests and must be configured explicitly to indicate what should be allowed.
ListcheckHeaders(@Nullable List requestHeaders)
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.
ListcheckHttpMethod(@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.
StringcheckOrigin(@Nullable String requestOrigin)
Check the origin of the request against the configured allowed origins.
CorsConfigurationcombine(@Nullable CorsConfiguration other)
Combine the non-null properties of the supplied CorsConfiguration with this one.
BooleangetAllowCredentials()
Return the configured allowCredentials flag, or null if none.
ListgetExposedHeaders()
Return the configured response headers to expose, or null if none.
LonggetMaxAge()
Return the configured maxAge value, or null if none.
voidsetAllowCredentials(@Nullable Boolean allowCredentials)
Whether user credentials are supported.
voidsetAllowedHeaders(@Nullable List allowedHeaders)
Set the list of headers that a pre-flight request can list as allowed for use during an actual request.
voidsetAllowedMethods(@Nullable List allowedMethods)
Set the HTTP methods to allow, e.g.
voidsetAllowedOrigins(@Nullable List allowedOrigins)
Set the origins to allow, e.g.
voidsetMaxAge(Duration maxAge)
Configure how long, as a duration, the response from a pre-flight request can be cached by clients.
voidsetMaxAge(@Nullable Long maxAge)
Configure how long, in seconds, the response from a pre-flight request can be cached by clients.