1
votes

In order to validate a captcha in Clojurescript I'm using cljs-http like this:

(def verify-url "https://www.google.com/recaptcha/api/siteverify")
;...
(http/post verify-url {:json-params {:secret key :response captcha-data}})
;...

...and the result is is:

{:status 0,
:success false,
:body "",
:headers {},
:trace-redirects ["https://www.google.com/recaptcha/api/siteverify" "https://www.google.com/recaptcha/api/siteverify"],
:error-code :http-error,
:error-text " [0]"}

What does this mean?

Thanks!

1

1 Answers

3
votes

Most probably your preflight (OPTIONS) requiest gets failed. Check your Developer Console for something like:

XMLHttpRequest cannot load https://www.google.com/recaptcha/api/siteverify. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:3449' is therefore not allowed access. The response had HTTP status code 405.