CORSConfig

更新时间:
复制 MD 格式

名称

类型

描述

示例值

object

CORS 配置

allowCredentials

boolean

是否允许发送凭据

true

allowHeaders

array

允许的请求头列表

string

允许的请求头名称。

Content-Type

allowMethods

array

允许的 HTTP 方法列表

string

允许的 HTTP 方法。

GET

allowOrigins

array

允许的来源列表

string

允许的来源。

https://example.com

exposeHeaders

array

暴露的响应头列表

string

允许暴露的响应头名称。

X-Custom-Header

maxAge

integer

预检请求缓存时间(秒)

3600