# Enable CORS for WebDev

**URL:** <https://forum.inductiveautomation.com/t/enable-cors-for-webdev/38655>\
**Category:** General Discussion\
**Created:** [September 14, 2020, 5:00pm UTC](https://forum.inductiveautomation.com/t/enable-cors-for-webdev/38655 "2020-09-14T17:00:34Z")\
**Posts on this page:** 1\
**Showing post:** 4

<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 17, 2021, 3:26pm UTC](https://forum.inductiveautomation.com/t/enable-cors-for-webdev/38655/4 "2021-11-17T15:26:50Z")

</div>

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:

```auto
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 in the response.

---

_[View the full topic](https://forum.inductiveautomation.com/t/enable-cors-for-webdev/38655)._
