Back

CORS error in Firefox (Chrome works)

  • 0
  • Databases
  • Web
  • Cloud
flo<3ler
4 Nov, 2024, 10:01

For my Cloud project with Next.js,I am getting CORS errors when attempting createDocument(), but in Chrome it all works fine:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://cloud.appwrite.io/v1/databases/***/collections/***/documents. (Reason: header ‘user-agent’ is not allowed according to header ‘Access-Control-Allow-Headers’ from CORS preflight response).

I am new to web development and wonder if there'n an easy solution for this? Maybe it's a browser configuration on my side, but a friend of mine who I asked to test it said that nothing happened, so I assume he also had an error in the background.

Again, Chrome works as expected with no changes to the code or Appwrite console🤔

TL;DR
Developers are experiencing CORS errors in Firefox but not in Chrome. They suspect Firefox is not sending specific headers like Chrome does. This is causing issues with requests to Cloud project. Possible solution is to check browser configurations or run tests on different devices.
flo<3ler
4 Nov, 2024, 10:19

I inspecter the Request Headers in the Browser Networks tab and it seems as iif Firefox doesn't sent the specific headers.

In Chrome, I can see the 'X-Appwrite-Project' and so on headers, but in Firefox they are not there. Could this be the issue?

And does anyone have a solution for this? AFAIK I have no special Firefox setub with addons that could interfere here.

Will update here if I find a solution for it!

flo<3ler
4 Nov, 2024, 10:40

Screenshot of the networks tab and the request

flo<3ler
4 Nov, 2024, 10:44

CORS error in Firefox (Chrome works)

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more