Libraries v5.0.0
    Preparing search index...

    Interface ServerCorsOptions

    Server-wide CORS policy, enabled explicitly with ServerBuilder.useCors().

    interface ServerCorsOptions {
        allowedHeaders?: readonly string[];
        credentials?: boolean;
        exposedHeaders?: readonly string[];
        maxAgeSeconds?: number;
        methods?: readonly string[];
        origin:
            | string
            | readonly string[]
            | ((origin: string) => boolean | Promise<boolean>);
    }
    Index
    allowedHeaders?: readonly string[]

    Permitted preflight header names (case-insensitive). Defaults to none; no wildcards.

    credentials?: boolean

    Allow browser credentials. Defaults to false; incompatible with origin: '*'.

    exposedHeaders?: readonly string[]

    Additional response headers browsers may read. Defaults to none; no wildcards.

    maxAgeSeconds?: number

    Browser preflight cache duration in seconds. Defaults to zero.

    methods?: readonly string[]

    Optional preflight allowlist, restricted to registered routes. No wildcards.

    origin:
        | string
        | readonly string[]
        | ((origin: string) => boolean | Promise<boolean>)

    Exact serialized origins, '*', or a predicate evaluated once per HTTP request with Origin.