anki-connect icon indicating copy to clipboard operation
anki-connect copied to clipboard

Allow 'content-type' header in requests

Open luisscholl opened this issue 3 years ago • 0 comments

Hi,

I am developing a client using Angular as the frontend and AnkiConnect as the backend. Thereby I run into a CORS issue. Angular's HttpClient (which has some benefits over plain Javascript) automatically adds the 'Content-Type' header and requests it in the preflight request with the header 'Access-Control-Request-Headers': 'content-type'. AnkiConnect however does not allow the 'Content-Type' header with 'Access-Control-Allow-Headers': 'content-type', which leads to the request being blocked due to the same origin policy. Angular does not support removing the header.

Could AnkiConnect allow the 'Content-Type' header, please?

luisscholl avatar Sep 20 '20 16:09 luisscholl