1
0
mirror of https://github.com/bingohuang/docker-labs.git synced 2025-07-14 01:57:32 +08:00

Allow to disable recaptcha explicitly by env variable

The reason for this is because sometimes in dev enviroments recaptcha
will might return a wrong answer, so it's nice to have a way to
explicitly disable it
This commit is contained in:
Marcos Lilljedahl 2016-11-16 01:23:50 -03:00
parent 7f9cf57f8f
commit a10f247812

View File

@ -32,6 +32,9 @@ type recaptchaResponse struct {
}
func IsHuman(req *http.Request) bool {
if os.Getenv("GOOGLE_RECAPTCHA_DISABLED") != "" {
return true
}
req.ParseForm()
challenge := req.Form.Get("g-recaptcha-response")