OpenStack SWIFT中的CORS支持 [英] CORS support in OpenStack SWIFT

查看:148
本文介绍了OpenStack SWIFT中的CORS支持的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何配置OpenStack SWIFT以发送所有适当的CORS标头,以响应客户端的OPTIONS请求?我知道SWIFT管道的跨域插件,但是文档只说允许以下内容:

How can I configure OpenStack SWIFT to send all the appropriate CORS headers in response to a client's OPTIONS request? I know about the crossdomain plugin to the SWIFT pipeline, but the documentation only says that something like the following is allowed:

[filter:crossdomain]
use = egg:swift#crossdomain
cross_domain_policy = <allow-access-from domain="xxx.yyy.com" />

它没有告诉我如何指定Access-Control-Allow-Header,Access-Control-Expose-Header,Access-Control-Allow-Credentials,Access-Control-Max-Age等标题.

It doesn't tell me how to specify the Access-Control-Allow-Headers, Access-Control-Expose-Headers, Access-Control-Allow-Credentials, Access-Control-Max-Age, etc. headers.

有人知道这是怎么做的吗?

Anyone know how this is done?

推荐答案

尽管文档非常混乱,但我认为我需要各种(不正确)形式的容器和对象元数据,事实证明我需要设置以下两个:

Despite very confusing documentation that led me to believe the container and object metadata of various (incorrect) forms were what I needed, it turned out that I needed to set the following two:

"Access-Control-Allow-Origin: xxx"
"Access-Control-Expose-Headers: X-Foo, X-Bar"

据说使用X-Access-Control-Allow-Origin和X-Container-Meta-Access-Control-Allow-Origin的各种文档不起作用.浏览完代码后,我微光了一下.

The various documentation that said to use X-Access-Control-Allow-Origin and X-Container-Meta-Access-Control-Allow-Origin didn't work. I gleamed the above after looking through the code.

这篇关于OpenStack SWIFT中的CORS支持的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆