CORS error when trying to login
Posted: Sat Aug 26, 2023 1:26 pm
Hi, I'm using the API and it has worked great for the last few months. Lately I started getting CORS errors when trying to use it.
The request I'm sending:
What can I do to fix it? It seems that the server is not including the Access-Control-Allow-* header
The request I'm sending:
Code: Select all
curl 'https://api.opensubtitles.com/api/v1/login' \
-H 'sec-ch-ua: "Chromium";v="116", "Not)A;Brand";v="24", "Google Chrome";v="116"' \
-H 'DNT: 1' \
-H 'sec-ch-ua-mobile: ?0' \
-H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36' \
-H 'access-control-allow-methods: GET, HEAD, POST, OPTIONS' \
-H 'Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7KYD8gVF1UxGs6rB' \
-H 'access-control-allow-origin: *' \
-H 'Accept: */*' \
-H 'Referer: http://127.0.0.1:5173/' \
-H 'api-key: <MY_API_KEY>' \
-H 'access-control-allow-headers: Origin, Authorization, Accept, Api-Key, Content-Type, X-User-Agent' \
-H 'sec-ch-ua-platform: "Windows"' \
--data-raw $'------WebKitFormBoundary7KYD8gVF1UxGs6rB\r\nContent-Disposition: form-data; name="username"\r\n\r\nasf\r\n------WebKitFormBoundary7KYD8gVF1UxGs6rB\r\nContent-Disposition: form-data; name="password"\r\n\r\nasf\r\n------WebKitFormBoundary7KYD8gVF1UxGs6rB--\r\n' \
--compressed