ampir3Original post
Web Developer
So I am hosting an appwrite instance via docker myself, I have added the website as a platform in the dashboard and also added the respective hostname to be enabled (localhost). Nevertheless it still gives me the following error, when trying to call Appwrite via my web app:
Access to XMLHttpRequest at 'http://127.0.0.1/v1/account' from origin 'http://localhost:5173' has been blocked by CORS policy: Request header field x-sdk-name is not allowed by Access-Control-Allow-Headers in preflight response.
Summary
Developers hosting their own Appwrite instance are encountering a CORS error when trying to access it from a SvelteKit web app. The error indicates that the x-sdk-name header is not allowed by the CORS policy. To resolve this, developers need to ensure that the x-sdk-name header is allowed in the Access-Control-Allow-Headers response.