I have setup the Ionic development environment using Yeoman generator (https://github.com/diegonetto/generator-ionic). Everything is works well.
The problem is on Sever side request, I am getting the Cross-Origin Request Blocked error.
I add below link in .htaccess file and AngularJS app.js, still getting same error
Header set Access-Control-Allow-Origin "*"
Header set Access-Control-Allow-Headers: Authorization
AngularJS Provider
$httpProvider.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=utf-8';
$httpProvider.defaults.withCredentials = true;
Error Message I am getting is
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at
http://192.168.1.18/tracker/user/login.
This can be fixed by moving the resource to the same domain or enabling CORS.
Screen of Request & Response Header
Please guide me any configuration need to be changed for enabling CORS. Our server side framework is Zend 1.x
The cross origin is forced by your browser, running the application from any distributed phone should not be blocked with your current settings.
To allow communication between your "served to browser" app to your server use a browser plugin
Allow-Control-Allow-Origin: * Chrome Plugin do the work
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With