Class CorsSupportBase<Q,​R,​T extends CorsSupportBase<Q,​R,​T,​B>,​B extends CorsSupportBase.Builder<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

    public abstract class CorsSupportBase<Q,​R,​T extends CorsSupportBase<Q,​R,​T,​B>,​B extends CorsSupportBase.Builder<Q,​R,​T,​B>>
    extends Object
    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.

    • Method Detail

      • processRequest

        protected Optional<R> processRequest​(CorsSupportBase.RequestAdapter<Q> requestAdapter,
                                             CorsSupportBase.ResponseAdapter<R> responseAdapter)
        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​(CorsSupportBase.RequestAdapter<Q> requestAdapter,
                                       CorsSupportBase.ResponseAdapter<R> responseAdapter)
        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 io.helidon.webserver.cors.CorsSupportHelper<Q,​R> helper()
      • describe

        protected String describe()
      • name

        protected String name()