Skip to content

resolveCorsOrigin

resolveCorsOrigin(origin, requestOrigin): string | undefined

Defined in: cors.ts:12

Resolve CorsOptions.origin against a request’s Origin header into the concrete value to send back as Access-Control-Allow-Origin, or undefined when the origin is disallowed (no CORS headers should be sent). Shared by all three HTTP transports so origin: true (reflect), a fixed string, an allow-list, and a custom function all behave identically regardless of which transport is mounted.

string | boolean | string[] | ((requestOrigin) => string | boolean) | undefined

string | undefined

string | undefined