403 Forbiddem with POST requests

Hello there! I’m developing my first mobile app with Ionic, and I’m stuck with a problem with POST requests. When I ionic serve the app, I’m able to perform the request. However, when I run the same app on an android emulator (or a real android device as well), the request fail with a 403 Forbidden.

The problem is already discussed here on the forum, I can confirm I have the file:// origin header, but I can’t just allow the origin on the server for security reasons. How to resolve?