Skip to content

CorsOptions

Defined in: src/plugins/middleware/cors.ts:4

Property Type Description Defined in

allowedHeaders?

string | string[]

HTTP headers to allow.

src/plugins/middleware/cors.ts:16

credentials?

boolean

Whether to allow credentials. NOTE: Cannot be combined with origin: "*" — browsers reject that combination.

src/plugins/middleware/cors.ts:25

exposedHeaders?

string | string[]

HTTP headers to expose.

src/plugins/middleware/cors.ts:20

maxAge?

number

Maximum age of preflight request.

src/plugins/middleware/cors.ts:29

methods?

string | string[]

HTTP methods to allow.

src/plugins/middleware/cors.ts:12

optionsSuccessStatus?

number

HTTP status code for successful OPTIONS preflight requests.

Default

204

src/plugins/middleware/cors.ts:39

origin?

string | string[] | (ctx) => string | boolean

Origin to allow. Can be a string, array of strings, or function that returns a string.

src/plugins/middleware/cors.ts:8

preflightContinue?

boolean

Whether to pass preflight requests to the next handler.

Default

false

src/plugins/middleware/cors.ts:34