mirror of
https://github.com/maxlerebourg/crowdsec-bouncer-traefik-plugin.git
synced 2026-07-21 03:28:59 +02:00
🐛 fix bug with recaptcha (#141) and add doc for recaptcha
* 🐛 fix bug with recaptcha * 📝 Add documentation for recpatcha --------- Co-authored-by: max.lerebourg <max.lerebourg@monisnap.com> Co-authored-by: mhx <mathieu@hanotaux.fr>
This commit is contained in:
co-authored by
max.lerebourg
mhx
parent
497d1a2928
commit
6059f23dc3
@@ -8,6 +8,7 @@ import (
|
||||
"net/http"
|
||||
"net/url"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
cache "github.com/maxlerebourg/crowdsec-bouncer-traefik-plugin/pkg/cache"
|
||||
configuration "github.com/maxlerebourg/crowdsec-bouncer-traefik-plugin/pkg/configuration"
|
||||
@@ -152,7 +153,8 @@ func (c *Client) Validate(r *http.Request) (bool, error) {
|
||||
c.log.Error(fmt.Sprintf("captcha:Validate %s", err.Error()))
|
||||
}
|
||||
}()
|
||||
if res.Header.Get("content-type") != "application/json" {
|
||||
if !strings.Contains(res.Header.Get("content-type"), "application/json") {
|
||||
c.log.Debug("captcha:Validate responseType:noJson")
|
||||
return false, nil
|
||||
}
|
||||
var captchaResponse responseProvider
|
||||
|
||||
Reference in New Issue
Block a user