# \[RESOLVED\] Setup CORS correctly

**URL:** <https://forum.mautic.org/t/resolved-setup-cors-correctly/28362>\
**Category:** Product Support\
**Created:** [June 19, 2023, 1:47pm UTC](https://forum.mautic.org/t/resolved-setup-cors-correctly/28362 "2023-06-19T13:47:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![waldgeist](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/waldgeist/32/5384_2.png) [@waldgeist](https://forum.mautic.org/u/waldgeist)\
**Post date:** [June 19, 2023, 1:47pm UTC](https://forum.mautic.org/t/resolved-setup-cors-correctly/28362/1 "2023-06-19T13:47:13Z")

</div>

**Your software**  
My Mautic version is: 3.1.2  
My PHP version is: 7.2.3.4  
My Database type and version is: MySQL (integrated in Bitnami stack)

**Your problem**  
I am trying to send form data from my own app to a Mautic form. My own form is based on React, so I only want to send the data over. I was following [this sample](https://gist.github.com/escopecz/136f62b66d526bc32006f0d2358a8e15) for this (which had been written for jQuery, but that doesn’t matter).

However, when I send the data over, I get a CORS error in the browser, because no `Access-Control-Origin` has been set. I have enabled CORS in the Mautic config, and also added some of my domains. However, if I try to send data with Postman, I can see that the `Access-Control-Origin` header is still empty, while all other CORS headers are set:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/e/e28cb12926241e26972116080a8849377f131b6d.png)

Is there anything special I have to setup to let Mautic answer with the correct Origin settings? I already send the `X-Requested-With` header with a value of `XMLHttpRequest`, before that no CORS headers were sent back. But maybe there’s another header I have to set?

---

<div class="post-metadata">

**Author:** ![waldgeist](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/waldgeist/32/5384_2.png) [@waldgeist](https://forum.mautic.org/u/waldgeist)\
**Post date:** [June 19, 2023, 1:53pm UTC](https://forum.mautic.org/t/resolved-setup-cors-correctly/28362/2 "2023-06-19T13:53:39Z")

</div>

Ok. It works if you add the domains with a protocol, like https.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/1X/43c63600fe51440378769136903f1fa2a9a34102.png) [@system](https://forum.mautic.org/u/system)\
**Post date:** [June 21, 2023, 3:21pm UTC](https://forum.mautic.org/t/resolved-setup-cors-correctly/28362/4 "2023-06-21T15:21:35Z")

</div>

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.
