rest-vir - v2.2.0
    Preparing search index...

    Function handleCors

    • Determines the required origin for the endpoint and compares it with the given request.

      If an OPTIONS request is being handled, a NoContent response is always sent, with all CORS headers set appropriately.

      For other requests:

      • If the request fails the origin checks, a Forbidden response is sent.
      • If the request passes origin checks, the appropriate CORS headers are set and a response is not sent (so further handlers can process it).

      Parameters

      • this: void
      • __namedParameters: Readonly<
            SelectFrom<RouteHandlerParams, { request: true; route: true }> & {
                api: ApiImplementation;
                disableRestVirApiNameHeader?: boolean;
                serverLogger: ServerLogger;
            },
        >

      Returns Promise<HandledOutput>