# Enable CORS- use web dev API for reactjs

**URL:** <https://forum.inductiveautomation.com/t/enable-cors-use-web-dev-api-for-reactjs/53402>\
**Category:** Ignition\
**Created:** [November 23, 2021, 7:13pm UTC](https://forum.inductiveautomation.com/t/enable-cors-use-web-dev-api-for-reactjs/53402 "2021-11-23T19:13:09Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [November 23, 2021, 7:31pm UTC](https://forum.inductiveautomation.com/t/enable-cors-use-web-dev-api-for-reactjs/53402/2 "2021-11-23T19:31:57Z")

</div>

As previously mentioned, you have the ability to return your own OPTIONS headers in Webdev. You have to write the code yourself to return the right header values. If you have some code written and it's not working, provide your code.

You're looking for a single solution to a problem for which there is no single solution. The right CORS headers to use are going to depend on your application. You _must_ do the research yourself.

> [@Enable CORS for WebDev](https://forum.inductiveautomation.com/t/enable-cors-for-webdev/38655/4):
>
> Your actual response headers will change based on the input request and what you want to allow it to do. The basic structure should be something like this: from javax.servlet.http import HttpServletResponse servletResponse = request["servletResponse"] servletResponse.addHeader(someCorsHeaders, someCorsValue) # other headers based on incoming request servletResponse.setStatus(HttpServletResponse.SC\_NO\_CONTENT) See [Cross-Origin Resource Sharing (CORS) - HTTP | MDN](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) for reference on what to send…

---

_[View the full topic](https://forum.inductiveautomation.com/t/enable-cors-use-web-dev-api-for-reactjs/53402)._
