APK and cross domain request issue

Just starting out? Need help? Post your questions and find answers here.
e2robot
Posts: 38
Joined: Wed Mar 19, 2014 8:34 am

APK and cross domain request issue

Post by e2robot »

I have a working web app that does a http request to run some cgi.

I converted it to an APK and it runs up on phone.

However the http request fails.

I can get it to work by changing the apache server hosting the cgi to allow cross site requests

Add in mod_headers.so
and in Directory section add
Header set Access-Control-Allow-Origin "*"

Is there another (better) way to do this ?
Enabling cross site is not recommened for apache security.


Thanks,
Phil
Fred
Site Admin
Posts: 1820
Joined: Mon Feb 24, 2014 10:51 am

Re: APK and cross domain request issue

Post by Fred »

I think it's the only way, as your app doesn't have a domain name. I don't exactly know for sure, maye some other people here can enlight you as well :)
cederavic
Posts: 30
Joined: Tue Feb 25, 2014 6:49 am

Re: APK and cross domain request issue

Post by cederavic »

it looks like it have to be setup in a crosswalk manifest : https://crosswalk-project.org/documenta ... hosts.html
e2robot
Posts: 38
Joined: Wed Mar 19, 2014 8:34 am

Re: APK and cross domain request issue

Post by e2robot »

Very interesting

Hopefully this could be added as a compiler option ?

Thanks
Phil
Post Reply