dopecodez / Wikipedia

Wikipedia for node and the browser
MIT License
82 stars 19 forks source link

CORS error fetching summary in Firefox #38

Closed mareiski closed 2 years ago

mareiski commented 2 years ago

I created a vue app where I want to show info to a specific location. This is my code for fetching the summary: const summary = await wiki.summary(pageName);

In chrome everything works perfectly, but in Firefox I'm getting this error:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://de.wikipedia.org/api/rest_v1/page/summary/Stuttgart. (Reason: header ‘user-agent’ is not allowed according to header ‘Access-Control-Allow-Headers’ from CORS preflight response).

dopecodez commented 2 years ago

can i know what os you are using and if you're using a proxy? Also the versions of your firefox and chrome would be helpful.

mareiski commented 2 years ago

Sure, thanks for your fast reply. I am on windows, not using any proxy. Firefox Developer Edition 100.0beta, Firefox Firefox 99.0 (normal edition) and Chrome 100.0.4896.75

mareiski commented 2 years ago

Is there an update on this issue?

mareiski commented 2 years ago

So its still not working in firefox for me, but also found out that its not working in Safari. So for my users its actually only working in chrome. Thats not acceptable, Now I have to search for another libary with better browser support

marcocosta1618 commented 2 years ago

I can confirm this issue on Firefox 91.10.0esr (64-bit), Firefox Quantum 101.0.1 (64-bit) and Safari 13.1.2. Not experiencing this on Chrome 102.0.5005.115 (Official Build) (x86_64) and ChromeDev 104.0.5110.0 (Official Build) dev (x86_64). Everything works as expected enabling extensions that bypass CORS restriction (e.g., CORS Everywhere for Firefox, Develop Menu > Disable CORS Restrictions on Safari)

dopecodez commented 2 years ago

Closed via #40 .

Sorry for the late work @mareiski . I was caught up in some work and couldnt take a proper look until today.

Fixed and available from wikipedia V1.1.9.

mareiski commented 2 years ago

Thank you, its working now!