naystack - v1.9.9
    Preparing search index...

    Function getCorsHeaders

    • Returns CORS headers for the given origin if it is in the allowed list.

      Parameters

      • origin: string | null

        The Origin header value from the request.

      • allowedOrigins: string[]

        List of permitted origins.

      Returns
          | {
              "Access-Control-Allow-Credentials": string;
              "Access-Control-Allow-Headers": string;
              "Access-Control-Allow-Methods": string;
              "Access-Control-Allow-Origin": string;
          }
          | null

      CORS headers object, or null if the origin is not allowed.