CORS error...simple fix

2 views
Skip to first unread message

Steven Moore

unread,
May 26, 2016, 6:08:35 AM5/26/16
to Europeana API forum
 
In the process of teaching myself d3.js, which is an awesome library, I used the Europeana REST API in a small project:  http://www.europeana-d3.info

I realized recently that it stopped working, and the error said something about the Access-Control-Allow-Origin header was missing.  After an hour or so of trying to set the header, I realized that my older working code had this...

var url = "https://europeana.eu/api/v2/search.json?query=...

when it needed to be this...

var url = "https://www.europeana.eu/api/v2/search.json?query=...

And as soon as I added "www" it started to work again.  I'm pretty sure I copied the original query syntax from an example, so it is possible that others did too.  Just a heads-up.

Steve

Remy Gardien

unread,
Jun 20, 2016, 9:26:02 AM6/20/16
to Europeana API forum
Hi Steve,

Thanks for this, very useful! We'll make sure we advertise the use of www.europeana.eu as much as possible and see if we can also expose these headers on the non-www domain.

Best,
Remy Gardien
Europeana
Reply all
Reply to author
Forward
0 new messages