Skip to main content
fixed a comma-splice sentence; fixed grammar and formatting; edited tags
Source Link
avpaderno
  • 97.9k
  • 15
  • 164
  • 284

I'm working on a Headlessheadless website based on Drupal 8,8; I installed the CORS module and in CORS domain set *|* , client. Client side can read my viewsview rest endpoint, but when client side try to load a file url returned by views rest result, I am faced with CORS error ,:

XMLHttpRequest cannot load http://domain.com/sites/default/files/home-slider-slide3-audio/2016-11/tr_SaidNursi.mp3. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://xx.domain.com' is therefore not allowed access.

XMLHttpRequest cannot load http://domain.com/sites/default/files/home-slider-slide3-audio/2016-11/tr_SaidNursi.mp3. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://xx.domain.com' is therefore not allowed access.

howHow can I resolve this problem?

myThe webserver is NGINXNginx.

I'm working on a Headless website based on Drupal 8, I installed CORS module and in CORS domain set *|* , client side can read my views rest endpoint but when client side try to load a file url returned by views rest result, I faced with CORS error ,

XMLHttpRequest cannot load http://domain.com/sites/default/files/home-slider-slide3-audio/2016-11/tr_SaidNursi.mp3. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://xx.domain.com' is therefore not allowed access.

how can I resolve this problem?

my webserver is NGINX

I'm working on a headless website based on Drupal 8; I installed the CORS module and in CORS domain set *|*. Client side can read my view rest endpoint, but when client side try to load a file url returned by views rest result, I am faced with CORS error:

XMLHttpRequest cannot load http://domain.com/sites/default/files/home-slider-slide3-audio/2016-11/tr_SaidNursi.mp3. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://xx.domain.com' is therefore not allowed access.

How can I resolve this problem?

The webserver is Nginx.

added 25 characters in body
Source Link
Yuseferi
  • 22.2k
  • 22
  • 118
  • 218

I'm working on a Headless website based on Drupal 8, I installed CORS module and in CORS domain set *|* , client side can read my views rest endpoint but when client side try to load a file url returned by views rest result, I faced with CORS error ,

XMLHttpRequest cannot load http://domain.com/sites/default/files/home-slider-slide3-audio/2016-11/tr_SaidNursi.mp3. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://xx.domain.com' is therefore not allowed access.

how can I resolve this problem?

my webserver is NGINX

I'm working on a Headless website based on Drupal 8, I installed CORS module and in CORS domain set *|* , client side can read my views rest endpoint but when client side try to load a file url returned by views rest result, I faced with CORS error ,

XMLHttpRequest cannot load http://domain.com/sites/default/files/home-slider-slide3-audio/2016-11/tr_SaidNursi.mp3. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://xx.domain.com' is therefore not allowed access.

how can I resolve this problem?

I'm working on a Headless website based on Drupal 8, I installed CORS module and in CORS domain set *|* , client side can read my views rest endpoint but when client side try to load a file url returned by views rest result, I faced with CORS error ,

XMLHttpRequest cannot load http://domain.com/sites/default/files/home-slider-slide3-audio/2016-11/tr_SaidNursi.mp3. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://xx.domain.com' is therefore not allowed access.

how can I resolve this problem?

my webserver is NGINX

Source Link
Yuseferi
  • 22.2k
  • 22
  • 118
  • 218

CORS error in reading file

I'm working on a Headless website based on Drupal 8, I installed CORS module and in CORS domain set *|* , client side can read my views rest endpoint but when client side try to load a file url returned by views rest result, I faced with CORS error ,

XMLHttpRequest cannot load http://domain.com/sites/default/files/home-slider-slide3-audio/2016-11/tr_SaidNursi.mp3. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://xx.domain.com' is therefore not allowed access.

how can I resolve this problem?