/security/cors/options/
修改跨域请求头设置
请求地址
/security/cors/options/
HTTP请求方法
POST
是否需要登陆授权
是,关于登录授权,参见授权机制
请求参数
必选 | 数据类型及范围 | 说明 | |
---|---|---|---|
bucket_name | true | string | 空间名 |
options | true | array | 设置内容 |
ignore_origin_header | false | bool | 开启后不论请求中是否包含 Origin 头,都会返回 cors 相关的头信息。不传则默认为 false |
options
完整结构如下:
[{
"allow_domains": ["*.foo.com","*.bar.com"],
"allow_methods": ["GET","POST"],
"allow_headers":["X-Foo","X-Bar"]
"expose_headers":["X-Foo","X-Bar"],
"max_age":86400
}]
{
"allow_domains": ["*.foo.com","*.bar.com"]
}
allow_domains
,其他选项不设置
返回结果
{
"result": true,
"data": {
"bucket_name": "bucket",
"enable": true,
"ignore_origin_header": false,
"options": [
{
"allow_domains": ["*.foo.com","*.bar.com"],
"allow_methods": ["GET","POST"],
"allow_headers":["X-Foo","X-Bar"],
"expose_headers":["X-Foo","X-Bar"],
"max_age":86400
},
{
"allow_domains": ["*.foo.com","*.bar.com"],
"allow_methods": ["GET","POST"],
"allow_headers":["X-Foo","X-Bar"],
"expose_headers":["X-Foo","X-Bar"],
"max_age":86400
},
]
}
}
Last edited by hubiao, 2016-03-21 17:44:32