# Native app is sending header Origin:file:// which causes problems

**URL:** <https://forum.ionicframework.com/t/native-app-is-sending-header-origin-file-which-causes-problems/62388>\
**Category:** ionic-v1\
**Created:** [September 2, 2016, 12:30pm UTC](https://forum.ionicframework.com/t/native-app-is-sending-header-origin-file-which-causes-problems/62388 "2016-09-02T12:30:53Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![johnymachine](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/johnymachine/32/102849_2.png) [@johnymachine](https://forum.ionicframework.com/u/johnymachine)\
**Post date:** [September 2, 2016, 12:30pm UTC](https://forum.ionicframework.com/t/native-app-is-sending-header-origin-file-which-causes-problems/62388/1 "2016-09-02T12:30:53Z")

</div>

Hello!

I have started building simple Todo app in **Ionic 1** and I discovered a problem with Origin header. (CORS related)

If i run

`ionic serve`

everything works fine in browser and i can make requests to my REST API on apache(tomcat). But when build my app for android or even in ionic viewer, all requests fail. Using a chrome debugger I managed to locate the problem.

Native app sends header

`Origin: file://`

which causes my server to deny requests. Seems to me that it should send correct Origin header with host. Screenshot with more details is attached below.

 ![image](https://global.discourse-cdn.com/ionicframework/original/3X/f/2/f2e8fe6ab26641372eed4b54b3e7068d8e8eded2.png)

What can I do about that?

Found related topic here: [http://stackoverflow.com/questions/25914071/cors-cordova-angularjs-http-and-file-confusion](http://stackoverflow.com/questions/25914071/cors-cordova-angularjs-http-and-file-confusion)

**EDIT:** Problem occurs when post, if I run ionic starter (tabs) template with only `$http.post('http://myapp.com/apiv1/device')` added to controller.

Thanks in advance!

---

_[View the full topic](https://forum.ionicframework.com/t/native-app-is-sending-header-origin-file-which-causes-problems/62388)._
