java.lang.Object
io.helidon.cors.CorsSupportHelper<Q,R>
- Type Parameters:
Q- type of request wrapped by request adapterR- type of response wrapped by response adapter
Deprecated, for removal: This API element is subject to removal in a future version.
Centralizes internal CORS support common logic for processing requests and preparing responses.
This class is reserved for internal Helidon use. Do not use it from your applications. It might change or vanish at any time.
To serve all masters, several methods here accept adapters for requests and responses. Both of these are minimal and very specific to the needs of CORS support.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classDeprecated, for removal: This API element is subject to removal in a future version.Builder class forCorsSupportHelpers.static enumDeprecated, for removal: This API element is subject to removal in a future version.Not for use by developers. CORS-related classification of HTTP requests. -
Method Summary
Modifier and TypeMethodDescriptionDeprecated, for removal: This API element is subject to removal in a future version.Aggregator that combines configuration and provides information based on request.booleanisActive()Deprecated, for removal: This API element is subject to removal in a future version.Reports whether this helper, due to its set-up, will have a chance of affecting any requests or responses.static StringDeprecated, for removal: This API element is subject to removal in a future version.Trim leading or trailing slashes of a path.parseHeader(String header) Deprecated, for removal: This API element is subject to removal in a future version.Parse list header value as a set.parseHeader(List<String> headers) Deprecated, for removal: This API element is subject to removal in a future version.Parse a list of list of headers as a set.voidprepareResponse(CorsRequestAdapter<Q> requestAdapter, CorsResponseAdapter<R> responseAdapter) Deprecated, for removal: This API element is subject to removal in a future version.Prepares a response with CORS headers, if the supplied request is in fact a CORS request and if upstream processing has not already determined the request should be refused.processRequest(CorsRequestAdapter<Q> requestAdapter, CorsResponseAdapter<R> responseAdapter) Deprecated, for removal: This API element is subject to removal in a future version.Processes a request according to the CORS rules, returning anOptionalof the response type if the caller should send the response immediately (such as for a preflight response or an error response to a non-preflight CORS request).toString()Deprecated, for removal: This API element is subject to removal in a future version.
-
Method Details
-
normalize
Deprecated, for removal: This API element is subject to removal in a future version.Trim leading or trailing slashes of a path.- Parameters:
path- The path.- Returns:
- Normalized path.
-
parseHeader
Deprecated, for removal: This API element is subject to removal in a future version.Parse list header value as a set.- Parameters:
header- Header value as a list.- Returns:
- Set of header values.
-
parseHeader
Deprecated, for removal: This API element is subject to removal in a future version.Parse a list of list of headers as a set.- Parameters:
headers- Header value as a list, each a potential list.- Returns:
- Set of header values.
-
isActive
public boolean isActive()Deprecated, for removal: This API element is subject to removal in a future version.Reports whether this helper, due to its set-up, will have a chance of affecting any requests or responses.- Returns:
- whether the helper might have any effect on requests or responses
-
processRequest
public Optional<R> processRequest(CorsRequestAdapter<Q> requestAdapter, CorsResponseAdapter<R> responseAdapter) Deprecated, for removal: This API element is subject to removal in a future version.Processes a request according to the CORS rules, returning anOptionalof the response type if the caller should send the response immediately (such as for a preflight response or an error response to a non-preflight CORS request).If the optional is empty, this processor has either:
- recognized the request as a valid non-preflight CORS request and has set headers in the response adapter, or
- recognized the request as a non-CORS request entirely.
In either case of an empty optional return value, the caller should proceed with its own request processing and sends its response at will as long as that processing includes the header settings assigned using the response adapter.
- Parameters:
requestAdapter- abstraction of a requestresponseAdapter- abstraction of a response- Returns:
- Optional of an error response if the request was an invalid CORS request; Optional.empty() if it was a valid CORS request
-
toString
Deprecated, for removal: This API element is subject to removal in a future version. -
prepareResponse
public void prepareResponse(CorsRequestAdapter<Q> requestAdapter, CorsResponseAdapter<R> responseAdapter) Deprecated, for removal: This API element is subject to removal in a future version.Prepares a response with CORS headers, if the supplied request is in fact a CORS request and if upstream processing has not already determined the request should be refused.- Parameters:
requestAdapter- abstraction of a requestresponseAdapter- abstraction of a response
-
aggregator
Deprecated, for removal: This API element is subject to removal in a future version.Aggregator that combines configuration and provides information based on request.- Returns:
- aggregator
-
helidon-webserver-corswithio.helidon.webserver.cors.CorsFeatureeither fromServiceRegistry, or through one of the feature's static factory or builder methods; paths configured in config are registered first, before paths configured through service registry; this class will be removed in a future version of Helidon