iya-sts
    Preparing search index...

    Variable decide

    decide: (
        req: any,
        options: any,
    ) => { allowed: boolean; code: string; origin: string; why: string } = decide

    Type Declaration

      • (
            req: any,
            options: any,
        ): { allowed: boolean; code: string; origin: string; why: string }
      • Decides whether a page on the request's origin may read the answer.

        Applies the module's four rules in order. It never refuses the request itself; it decides only whether CORS headers are sent.

        Parameters

        • req: any

          the express request

        • options: any

          preflight: true for an OPTIONS preflight, which is judged against the realm because it names no client

        Returns { allowed: boolean; code: string; origin: string; why: string }

        { allowed, origin, code, why }, where code is the error code of a withheld decision about a cross-origin request, or empty