<p><br>
Hi Adrian,</p>
<p>Good to know this is a known issue.</p>
<p>Why does the client need to see custom headers from the server anyway? <br>
I know the client needs to pass the authorisation header to the server, but I haven't seen any of the APIs yet that return custom headers. (It's likely I'm missing them though)</p>
<p>Nick<br>
</p>
<div class="gmail_quote">On Apr 23, 2012 5:40 PM, "Adrian Smith" <<a href="mailto:adrian@17od.com">adrian@17od.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Nick,<br>
<br>
I did some work with CORS a few months back [1].<br>
<br>
At the time I couldn't get any browser to work properly with CORS so I<br>
just parked the code. The problem was lack of support for the<br>
Access-Control-Expose-Headers header.<br>
<br>
According to the Chrome bug report [2] this issue may well be fixed<br>
now so I need to retest.<br>
<br>
Adrian<br>
<br>
[1] <a href="http://www.mail-archive.com/openstack@lists.launchpad.net/msg07219.html" target="_blank">http://www.mail-archive.com/openstack@lists.launchpad.net/msg07219.html</a><br>
[2] <a href="http://code.google.com/p/chromium/issues/detail?id=87338" target="_blank">http://code.google.com/p/chromium/issues/detail?id=87338</a><br>
<br>
<br>
On 23 April 2012 06:19, Nick Lothian <<a href="mailto:nick.lothian@gmail.com">nick.lothian@gmail.com</a>> wrote:<br>
> Hi,<br>
><br>
> I've been playing with the Nova APIs from Javascript, and I've run into a<br>
> problem.<br>
><br>
> The very first thing one needs to do to use the APIs is to get a token.<br>
><br>
> That requires a POST to the API endpoint. Using curl & trystack that looks<br>
> like this:<br>
><br>
> $ curl -k -X 'POST' -v <a href="https://nova-api.trystack.org:5443/v2.0/tokens" target="_blank">https://nova-api.trystack.org:5443/v2.0/tokens</a> -d<br>
> '{"auth":{"passwordCredentials":{"username": "<username>",<br>
> "password":"<password>"}}}' -H 'Content-type: application/json'<br>
><br>
><br>
> The Javascript equivalent (using JQuery) is:<br>
><br>
>     $.ajax({<br>
>         url: "<a href="https://nova-api.trystack.org:5443/v2.0/tokens" target="_blank">https://nova-api.trystack.org:5443/v2.0/tokens</a>",<br>
>         type: 'POST',<br>
>         headers: {"Content-Type": "application/json"},<br>
>         data:  {"auth":{"passwordCredentials":{"username":"<username>",<br>
> "password":"<password>"}}},<br>
>         success: function(data) { alert(data); }<br>
>     });<br>
><br>
> That fails because the call is cross-domain, and Nova doesn't support CORS<br>
> (<a href="http://en.wikipedia.org/wiki/Cross-origin_resource_sharing" target="_blank">http://en.wikipedia.org/wiki/Cross-origin_resource_sharing</a>). <script> based<br>
> cross-domain requests only supports GET requests, so that doesn't work<br>
> either.<br>
><br>
> I have raised a bug: <a href="https://bugs.launchpad.net/nova/+bug/987044" target="_blank">https://bugs.launchpad.net/nova/+bug/987044</a>, but I'm<br>
> really hoping someone can point out something obvious I'm missing here.<br>
><br>
> Regards<br>
>   Nick Lothian<br>
><br>
> _______________________________________________<br>
> Mailing list: <a href="https://launchpad.net/~openstack" target="_blank">https://launchpad.net/~openstack</a><br>
> Post to     : <a href="mailto:openstack@lists.launchpad.net">openstack@lists.launchpad.net</a><br>
> Unsubscribe : <a href="https://launchpad.net/~openstack" target="_blank">https://launchpad.net/~openstack</a><br>
> More help   : <a href="https://help.launchpad.net/ListHelp" target="_blank">https://help.launchpad.net/ListHelp</a><br>
><br>
</blockquote></div>