Class HttpInboundEndpointSupportSpec.CrossOriginSpec
java.lang.Object
org.springframework.integration.http.dsl.HttpInboundEndpointSupportSpec.CrossOriginSpec
- Enclosing class:
- HttpInboundEndpointSupportSpec<S extends HttpInboundEndpointSupportSpec<S,E>,E extends BaseHttpInboundEndpoint>
public static final class HttpInboundEndpointSupportSpec.CrossOriginSpec extends Object
A fluent API for the
CrossOrigin.-
Method Summary
Modifier and Type Method Description HttpInboundEndpointSupportSpec.CrossOriginSpecallowCredentials(Boolean allowCredentials)Whether the browser should include any cookies associated with the domain of the request being annotated.HttpInboundEndpointSupportSpec.CrossOriginSpecallowedHeaders(String... allowedHeaders)List of request headers that can be used during the actual request.HttpInboundEndpointSupportSpec.CrossOriginSpecexposedHeaders(String... exposedHeaders)List of response headers that the user-agent will allow the client to access.HttpInboundEndpointSupportSpec.CrossOriginSpecmaxAge(long maxAge)The maximum age (in seconds) of the cache duration for pre-flight responses.HttpInboundEndpointSupportSpec.CrossOriginSpecmethod(RequestMethod... method)List of supported HTTP request methods, e.g.HttpInboundEndpointSupportSpec.CrossOriginSpecorigin(String... origin)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-Originheader 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-Headersheader."*"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-Headersheader.- 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- thebooleanflag to includeAccess-Control-Allow-Credentials=truein 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-Ageheader in the pre-flight response.- Parameters:
maxAge- the maximum age (in seconds) of the cache duration for pre-flight responses.- Returns:
- the spec
-