Class CorsSupportBase<Q,R,T extends CorsSupportBase<Q,R,T,B>,B extends CorsSupportBase.Builder<Q,R,T,B>>

java.lang.Object
io.helidon.cors.CorsSupportBase<Q,R,T,B>
Type Parameters:
Q - request type wrapped by request adapter
R - response type wrapped by response adapter
T - concrete subclass of CorsSupportBase
B - builder for concrete type <T>
Direct Known Subclasses:
CorsSupport

@Deprecated(forRemoval=true, since="4.4.0") public abstract class CorsSupportBase<Q,R,T extends CorsSupportBase<Q,R,T,B>,B extends CorsSupportBase.Builder<Q,R,T,B>> extends Object
Deprecated, for removal: This API element is subject to removal in a future version.
this module will be removed, CORS configuration is centralized to module helidon-webserver-cors with io.helidon.webserver.cors.CorsFeature either from ServiceRegistry, 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
A Helidon service and handler implementation that implements CORS, for both the application and for built-in Helidon services (such as OpenAPI and metrics).

The caller can set up the CorsSupportBase in a combination of these ways:

  • from a Config node supplied programmatically,
  • from one or more CrossOriginConfig objects supplied programmatically, each associated with a path to which it applies, and
  • by setting individual CORS-related attributes on the CorsSupportBase.Builder (which affects the CORS behavior for the "{+}" path).

See the CorsSupportBase.Builder.build() method for how the builder resolves conflicts among these sources.

If none of these sources is used, the CorsSupportBase applies defaults as described for CrossOriginConfig.

  • Constructor Details

    • CorsSupportBase

      protected CorsSupportBase(CorsSupportBase.Builder<Q,R,T,B> builder)
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Method Details

    • processRequest

      protected Optional<R> processRequest(CorsRequestAdapter<Q> requestAdapter, CorsResponseAdapter<R> responseAdapter)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Not for developer use. Submits a request adapter and response adapter for CORS processing.
      Parameters:
      requestAdapter - wrapper around the request
      responseAdapter - wrapper around the response
      Returns:
      Optional of the response type U; present if the response should be returned, empty if request processing should continue
    • prepareResponse

      protected void prepareResponse(CorsRequestAdapter<Q> requestAdapter, CorsResponseAdapter<R> responseAdapter)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Not for developer user. Gets a response ready to participate in the CORS protocol.
      Parameters:
      requestAdapter - wrapper around the request
      responseAdapter - wrapper around the reseponse
    • helper

      protected CorsSupportHelper<Q,R> helper()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • describe

      protected String describe()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • name

      protected String name()
      Deprecated, for removal: This API element is subject to removal in a future version.