1

I used this document : http://docs.openstack.org/developer/swift/cors.html#test-cors-page

Used the below code, sends Option request and get 200 as the response. But the orginal method 'get' doesn't get response. And browser console says 'Access-Control-Allow-Origin' CORS header is not found.

$.ajax({
    method: "GET",
    url : url,
    crossDomain: true,
    headers: {
        'X-Container-Meta-Access-Control-Allow-Origin' : 'http://127.0.0.1:8080',
        'X-Container-Meta-Access-Control-Max-Age' : 10,
        'X-Auth-Token' : token
    },  
    contentType : 'application/json; charset=utf-8'
});
hjjo
  • 105
  • 1
  • 6

1 Answers1

0

If memory serves the SL Object Storage only support CORS on containers and not individual objects. The following headers should be supported:

X-Container-Meta-Access-Control-Allow-Origin
Origins to be allowed to make Cross Origin Requests, space separated.

X-Container-Meta-Access-Control-Max-Age
Max age for the Origin to hold the preflight results.

X-Container-Meta-Access-Control-Expose-Headers
Headers exposed to the user agent (e.g. browser) in the actual request response, space separated.

greyhoundforty
  • 239
  • 2
  • 9