# CORS error - preflight request

**URL:** https://forum.woosmap.com/t/cors-error-preflight-request/107
**Category:** Ask the community
**Created:** [November 10, 2021, 8:49am UTC](https://forum.woosmap.com/t/cors-error-preflight-request/107 "2021-11-10T08:49:34Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Sophie\_wgs](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.woosmap.com/sophie_wgs/32/32_2.png) [@Sophie\_wgs](https://forum.woosmap.com/u/Sophie_wgs)
#### Post date: [November 10, 2021, 8:49am UTC](https://forum.woosmap.com/t/cors-error-preflight-request/107/1 "2021-11-10T08:49:34Z")

</div>

Why a CORS error with message  
‘Access to XMLHttpRequest has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.’

---

<div class="post-metadata">

### Author: ![gael](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.woosmap.com/gael/32/3_2.png) [@gael](https://forum.woosmap.com/u/gael)
#### Post date: [November 15, 2021, 1:08pm UTC](https://forum.woosmap.com/t/cors-error-preflight-request/107/2 "2021-11-15T13:08:19Z")

</div>

Hello,

For some cross-site requests the browser first makes a **“preflight” request**. It sends an HTTP request using the `OPTIONS` method to the server hosting the cross-origin resource (the Woosmap servers), in order to determine if the actual request is safe to send.

Currently, the Woosmap APIs do not set the needed ` Access-Control-Allow-Origin` header in response to an `OPTIONS` request.  
The fix, for now, is to avoid sending CORS Preflight by keeping the [request simple](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#simple_requests).

Please note that using the Woosmap JS Libraries ([Localities JS](https://developers.woosmap.com/products/localities/localities-jsapi/get-started/), [MultiSearch JS](https://developers.woosmap.com/products/multisearch-js-lib/get-started/)) usually prevents the CORS Errors as the requests are sent without any additional headers.

The team is aware of this limitation and working to patch the APIs.

---

<div class="post-metadata">

### Author: ![gael](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.woosmap.com/gael/32/3_2.png) [@gael](https://forum.woosmap.com/u/gael)
#### Post date: [October 20, 2023, 2:53pm UTC](https://forum.woosmap.com/t/cors-error-preflight-request/107/3 "2023-10-20T14:53:20Z")

</div>

A patch has been deployed. All Woosmap services now support preflight request.
