# HttpClient CORS security issues

**URL:** <https://forum.ionicframework.com/t/httpclient-cors-security-issues/225503>\
**Category:** Ionic Angular\
**Created:** [July 29, 2022, 1:04pm UTC](https://forum.ionicframework.com/t/httpclient-cors-security-issues/225503 "2022-07-29T13:04:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![xabierjj](https://avatars.discourse-cdn.com/v4/letter/x/6bbea6/32.png) [@xabierjj](https://forum.ionicframework.com/u/xabierjj)\
**Post date:** [July 29, 2022, 1:04pm UTC](https://forum.ionicframework.com/t/httpclient-cors-security-issues/225503/1 "2022-07-29T13:04:16Z")

</div>

Hello,

We are developing an ionic (Angular) application for ios and android that consumes a REST api we have developed. As you may know, in order to communicate with the backend, if we use the angular http client we have to configure the CORS by adding in the allowed headers capacitor://localhost and [http://localhost](http://localhost).

Isn’t this a problem in terms of security? With this configuration any mobile application could make calls to our api, right?

---

<div class="post-metadata">

**Author:** ![twestrick](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/twestrick/32/136131_2.png) [@twestrick](https://forum.ionicframework.com/u/twestrick)\
**Post date:** [July 29, 2022, 1:55pm UTC](https://forum.ionicframework.com/t/httpclient-cors-security-issues/225503/2 "2022-07-29T13:55:44Z")

</div>

Sure, another mobile application running on `localhost` could make requests to your API. But, really anyone could as well from the server side as CORS is only a browser/front-end mechanism.

Some ways to mitigate risk is having authentication for your API and rate limiting.
