Class HttpInboundEndpointSupportSpec.CrossOriginSpec
java.lang.Object
org.springframework.integration.http.dsl.HttpInboundEndpointSupportSpec.CrossOriginSpec
- Enclosing class:
- HttpInboundEndpointSupportSpec<S extends HttpInboundEndpointSupportSpec<S,
E>, E extends BaseHttpInboundEndpoint>
A fluent API for the
CrossOrigin
.-
Method Summary
Modifier and TypeMethodDescriptionallowCredentials
(Boolean allowCredentials) Whether the browser should include any cookies associated with the domain of the request being annotated.allowedHeaders
(String... allowedHeaders) List of request headers that can be used during the actual request.exposedHeaders
(String... exposedHeaders) List of response headers that the user-agent will allow the client to access.maxAge
(long maxAge) The maximum age (in seconds) of the cache duration for pre-flight responses.method
(RequestMethod... method) List of supported HTTP request methods, e.g.List of allowed origins, e.g.
-
Method Details
-
origin
List of allowed origins, e.g."https://domain1.com"
.These values are placed in the
Access-Control-Allow-Origin
header of both the pre-flight response and the actual response."*"
means that all origins are allowed.If undefined, all origins are allowed.
- Parameters:
origin
- the list of allowed origins.- Returns:
- the spec
-
allowedHeaders
List of request headers that can be used during the actual request.This property controls the value of the pre-flight response's
Access-Control-Allow-Headers
header."*"
means that all headers requested by the client are allowed.- Parameters:
allowedHeaders
- the list of request headers.- Returns:
- the spec
-
exposedHeaders
List of response headers that the user-agent will allow the client to access.This property controls the value of actual response's
Access-Control-Expose-Headers
header.- Parameters:
exposedHeaders
- the list of response headers.- Returns:
- the spec
-
method
List of supported HTTP request methods, e.g."{RequestMethod.GET, RequestMethod.POST}"
.Methods specified here override those specified via
RequestMapping
.- Parameters:
method
- the list of supported HTTP request methods- Returns:
- the spec
-
allowCredentials
Whether the browser should include any cookies associated with the domain of the request being annotated.Set to
"false"
if such cookies should not included.- Parameters:
allowCredentials
- theboolean
flag to includeAccess-Control-Allow-Credentials=true
in pre-flight response or not- Returns:
- the spec
-
maxAge
The maximum age (in seconds) of the cache duration for pre-flight responses.This property controls the value of the
Access-Control-Max-Age
header in the pre-flight response.- Parameters:
maxAge
- the maximum age (in seconds) of the cache duration for pre-flight responses.- Returns:
- the spec
-