Apache Cordova (Phonegap): is jsop needed for cross-site scripting?

Posted by DEX on Stack Overflow See other posts from Stack Overflow or by DEX
Published on 2013-10-24T21:50:42Z Indexed on 2013/10/24 21:54 UTC
Read the original article Hit count: 174

Filed under:
|
|
|
|

I've just started using Apache Cordova. I have an library that makes calls (via ajax) to a soap server.

When I run these on my local machine in chrome, I get cross site scripting errors when trying to make calls to the service.

When I run the same exact code using the Cordova browser in the iOS emulator, the scripts seem to hit the server fine and the response data is received properly.

So my question is how is the Cordova browser able to make these requests without cross-site scripting permissions & JSONP ? One thing I noticed is that when the request is sent from iOS, there is no "Origin" header. Is this allowing the Cordova browser to stealthily circumvent cross-site scripting requirements? Is it possible that the node.js server on the device (I believe this is how Cordova works) is manipulating the headers to allow this?

I'd like to avoid enabling cross-site scripting on my site so I think this "feature" is nice, but I'm wondering if it's a security hole as well.

Anyone have experience with this?

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about AJAX