CorsOptions
Defined in: types.ts:212
Normalized CORS option shape shared by @mantlejs/express, @mantlejs/koa, and @mantlejs/http so
switching transports doesn’t require relearning CORS configuration. Each transport translates this
into its own mechanism — the cors package, @koa/cors, or hand-rolled headers for @mantlejs/http.
Properties
Section titled “Properties”allowedHeaders?
Section titled “allowedHeaders?”
optionalallowedHeaders?:string[]
Defined in: types.ts:218
Allowed request headers for Access-Control-Allow-Headers. Default: reflects Access-Control-Request-Headers.
credentials?
Section titled “credentials?”
optionalcredentials?:boolean
Defined in: types.ts:222
Allow credentials (cookies, Authorization header) cross-origin. Default: false.
exposedHeaders?
Section titled “exposedHeaders?”
optionalexposedHeaders?:string[]
Defined in: types.ts:220
Headers exposed to the browser via Access-Control-Expose-Headers.
maxAge?
Section titled “maxAge?”
optionalmaxAge?:number
Defined in: types.ts:224
How long, in seconds, browsers may cache a preflight response (Access-Control-Max-Age).
methods?
Section titled “methods?”
optionalmethods?:string[]
Defined in: types.ts:216
Allowed methods for Access-Control-Allow-Methods. Default: ["GET", "POST", "PUT", "PATCH", "DELETE"].
origin?
Section titled “origin?”
optionalorigin?:string|boolean|string[] | ((requestOrigin) =>string|boolean)
Defined in: types.ts:214
Allowed origin(s) for Access-Control-Allow-Origin. true reflects the request’s Origin header. Default: true.