Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Sling model exporter + ReactJS - CORS error

Avatar

Level 2

Hello.

Could you give me some advice on how to fix the error:

aliaksandr_hvoz_0-1586061483205.png

 

I created a Sling Model with an exporter and I'm trying to get JSON on request from the ReactJS App.

ReactJS app:

aliaksandr_hvoz_1-1586036150777.png

aliaksandr_hvoz_0-1586061233842.png

 

 

I also created a filter for the set headers for CORS:

aliaksandr_hvoz_3-1586036270269.png

aliaksandr_hvoz_1-1586061305291.png

 

 

If I make a request from the browser, I will get JSON but not from ReactApp.

 

And configuration from AEM:

aliaksandr_hvoz_5-1586036493658.png

I use AEM 6.4 version. 

Could you please tell how to solve this problem.

 

Thanks in advance for any advice.

 

 

 
1 Accepted Solution

Avatar

Correct answer by
Community Advisor

@aliaksandr_hvoz 

Have you tried configuring the "Apache Sling Referrer Filter OSGI configuration"?

Documentation here: https://sourcedcode.com/in-aem-what-is-the-apache-sling-referrer-filter-osgi-configuration

View solution in original post

0 Replies

Avatar

Correct answer by
Community Advisor

@aliaksandr_hvoz 

Have you tried configuring the "Apache Sling Referrer Filter OSGI configuration"?

Documentation here: https://sourcedcode.com/in-aem-what-is-the-apache-sling-referrer-filter-osgi-configuration