Swift CORS - proxy server conf cors_allow_origin not taking affect

asked 2015-04-14 12:43:16 -0500

PeterTr7 gravatar image

updated 2015-04-15 02:45:50 -0500

SGPJ gravatar image

I'm currently running an instance of Swiftbrowser.

The browser is successful in listing objects of containers but is unable to download or upload files.

The following error occurs when attempting to upload:

  XMLHttpRequest cannot load http://X.X.X.X:8080/v1/AUTH_6de1834a803b4c1d95d362959bd01e14/container/. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://mydomain.com' is therefore not allowed access. The response had HTTP status code 500.

According the proxy configuration docs I am able to set the option cors_allow_origin. After doing so and restarting the proxy server, I am still receiving the error. I am unsure if this option is actually applying the required "Access-Control-Allow-Origin" header. According to my Chrome dev tools this particular header to allow CORS is not set.

My server conf file looks something like this:

[DEFAULT]
bind_port = 8080
user = swift
cors_allow_origin = http://mydowmain.com

...

[pipeline:main]
pipeline = crossdomain ...

...
[filter:crossdomain]
use = egg:swift#crossdomain
cross_domain_policy = <allow-access-from domain="http://mydomain.com" secure="false"/>

In addition, I've implemented the instructions on Cross-domain Policy Files including the extra proxy config options and putting a crossdomain.xml file on my server's root directory.

Is there something I missed or other options available to enable CORS for all containers from a specific domain?

edit retag flag offensive close merge delete