Furry / 2captcha

A wrapper around the 2captcha api
71 stars 23 forks source link

Access-Control-Allow-Origin issue #20

Closed romah1 closed 2 years ago

romah1 commented 2 years ago

I was using your script in google browser to resolve reCaptcha v3 and always got some CORS error which said that Access-Control-Allow-Origin header is missing On 2captcha it is said that if header_acao header is set to 1, in.php will include Access-Control-Allow-Origin header in the response. By default in your script it is set to 0. In .recaptcha method I can set header_acao to 1, but it won't change in .pollResponse method, which causes the error. Setting header_acao to 1 solved the issue for me

Also I would like to know if action header in .pollResponse request needs to be the same as action header in the request than .recaptcha sends

Anyway, thanks a lot for the script, it is really nice

Furry commented 2 years ago

Hiya, thanks for opening this issue!

I've just fixed this problem in commit c2505f6, as well as republished the change to NPM 2captcha@2.1.10.

When creating a new 'Solver' instance, you now have the option to specify acao properties as the third parameter, as well as it's now enabled by default within all endpoints.