Origin file:// produce 403 Forbidden from REST API


I need help for the following problem. If I start the app with the command ‘ionic run --device -l’ everything ist ok.
I can see that ionic set in request header of REST -API the Origin : localhost:8100.
But if I start the app without liveload with command ‘ionic run --device’ the Origin would set to file://
My API backend allows every origin, with an IP or an hostname but not file://, here I get the code 403 Forbidden.

So why is cordova set the origin to file://? How I can solve the problem?

I have the same problem. I can’t figure out what is the problem.
I have an app that I’m testing on android device and even if all the “get requests” with $http work fine, when I tried to call a service with post method I get a “forbidden” response.
The server is configured in the right way because all the requests works and I have whitelist plugin installed.
The strange thing is that with chrome browser the call seems to work fine.
Please help me.

Hi, same problem here. Any solution?

I am in the same boat currently. Requests work fine with livereload but without they are throwing a 403 forbidden. SOS