12-15-2012 11:09 AM - edited 12-15-2012 11:14 AM
While porting my app from WebWorks for PlayBook to BlackBerry 10 using the Gold SDK I came across two errors regarding XHR requests which are unfortunately breaking my app.
Firstly while trying to send cross domain requests the WebInspector gives me the following error:
Origin local:// is not allowed by Access-Control-Allow-Origin.
I have declared this in the config.xml:
The second error I encountered, which could of course be due to the requests not being send properly, is the fact that
doesn't seem to do anything at all. I don't get any error message but it also does not add any headers to the request. I am using it to add HTTP basic authentication to the requests:
var auth = window.btoa(this.user+':'+this.passwd); req.setRequestHeader('Authorization', 'Basic '+auth);
I am trying this using the simulator, it all works fine using ripple with disabled SOP. The same codebase also worked fine on the PlayBook. Unfortunately I don't have any real BB10 device to test my app on yet.
I also can't change anything about the server I am sending to, so the Authorization header is required for my app to work
12-16-2012 06:48 AM
I've written quite a lot about this in the last few days
I'm not sure about your auth stuff as I never use it for server requests
Basically my posts point you at some tested source that defo works
The other thing to do is test using the simulator
I go into the problem quite deeply so the other posts are worth a read
Can't be positive my stuff will fix you but it's solved other peoples problems