Page 1 of 1

APK and cross domain request issue

Posted: Sat Nov 05, 2016 9:33 am
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

Re: APK and cross domain request issue

Posted: Sat Nov 05, 2016 9:40 am
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 :)

Re: APK and cross domain request issue

Posted: Sat Nov 05, 2016 9:59 am
by cederavic
it looks like it have to be setup in a crosswalk manifest : https://crosswalk-project.org/documenta ... hosts.html

Re: APK and cross domain request issue

Posted: Sun Nov 06, 2016 12:30 am
by e2robot
Very interesting

Hopefully this could be added as a compiler option ?

Thanks
Phil