# Enable CORS policy on FSCrawler REST Client

**URL:** <https://discuss.elastic.co/t/enable-cors-policy-on-fscrawler-rest-client/162005>\
**Category:** Elasticsearch\
**Created:** [December 24, 2018, 1:54pm UTC](https://discuss.elastic.co/t/enable-cors-policy-on-fscrawler-rest-client/162005 "2018-12-24T13:54:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Carlos\_Pinedo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carlos_pinedo/32/39140_2.png) [@Carlos\_Pinedo](https://discuss.elastic.co/u/Carlos_Pinedo)\
**Post date:** [December 24, 2018, 1:54pm UTC](https://discuss.elastic.co/t/enable-cors-policy-on-fscrawler-rest-client/162005/1 "2018-12-24T13:54:24Z")

</div>

I'm trying to create an Angular 7 web app where I can add PDF contents directly into a Elasticsearch service. I created the file uploader in the app and I started a FSCrawler REST client to send the file requests. But when I try it, the web browser pops out this in console:

`"Access to XMLHttpRequest at 'http://127.0.0.1:8080/fscrawler' from origin 'http://localhost:4200' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource."`

I tried previously to make some opps directly on the Elasticsearch client (creating an index e.g) and I enabled the CORS in my Elasticsearch so it worked. But even with that done, this FSCrawler request doesn't work.  
Anyone can help me please? thx

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [December 24, 2018, 2:50pm UTC](https://discuss.elastic.co/t/enable-cors-policy-on-fscrawler-rest-client/162005/2 "2018-12-24T14:50:05Z")

</div>

I don't think I can add more than what I wrote on [the original issue](https://github.com/dadoonet/fscrawler/issues/654). Something needs to be done on FSCrawler side but it's not implemented yet.

---

<div class="post-metadata">

**Author:** ![Carlos\_Pinedo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carlos_pinedo/32/39140_2.png) [@Carlos\_Pinedo](https://discuss.elastic.co/u/Carlos_Pinedo)\
**Post date:** [December 24, 2018, 3:15pm UTC](https://discuss.elastic.co/t/enable-cors-policy-on-fscrawler-rest-client/162005/3 "2018-12-24T15:15:38Z")

</div>

Maybe something like adding CORS headers inside the REST API FSCrawler Java classes could solve the problem?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [December 24, 2018, 8:48pm UTC](https://discuss.elastic.co/t/enable-cors-policy-on-fscrawler-rest-client/162005/4 "2018-12-24T20:48:21Z")

</div>

Yes. Maybe.

PR are warmly welcomed. 😉

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [January 21, 2019, 8:48pm UTC](https://discuss.elastic.co/t/enable-cors-policy-on-fscrawler-rest-client/162005/5 "2019-01-21T20:48:23Z")

</div>

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