[aerogear-dev] Aerogear.js CORS & Android browser

Apostolos Emmanouilidis aemmanou at redhat.com
Tue Jun 18 10:36:13 EDT 2013


Hi,

I'm testing the CORS support on Aerogear.js.

Initially, I executed some CORS tests from Mozilla Firefox v21.0 and
received the Error: "jqXHR.getResponseHeader(..) is null aerogear.js
line 605" when testing the weblinking (attached screenshot).

However, I think that this error is not related to the AeroGear.js. 

I managed to overcome this issue in Firefox by adding an extra header to
the service response which sets a server whitelist headers that browsers
are allowed to access:

        Access-Control-Expose-Headers: Link


The problem is that it still fails on the Android emulator browser.

The header tests were also failing in Firefox and passed after adding
the following header in the Response headers:

        Access-Control-Expose-Headers: next,previous
        

But on the Android emulator the header tests are failing. I captured the
requests using a proxy between the emulator and the REST service and
found that the constructed URLs for next and previous calls are wrong.
This happens because the custom response headers cannot be read.

In conclusion, I think that the Access-Control-Expose-Headers header is
not supported by the Android browser and for that reason the CORS tests
are failing. There is a relevant open issue [2] in the Android project.

[1]: http://api.jquery.com/jQuery.ajax/
[2]: http://code.google.com/p/android/issues/detail?id=56726
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/aerogear-dev/attachments/20130618/fe5b6123/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CORS_AeroGear-js.png
Type: image/png
Size: 130059 bytes
Desc: not available
Url : http://lists.jboss.org/pipermail/aerogear-dev/attachments/20130618/fe5b6123/attachment-0001.png 


More information about the aerogear-dev mailing list