mirror of
https://github.com/maxlerebourg/crowdsec-bouncer-traefik-plugin.git
synced 2026-07-21 11:38:59 +02:00
fix lint
This commit is contained in:
@@ -144,8 +144,6 @@ func New(ctx context.Context, next http.Handler, config *Config, name string) (h
|
|||||||
return bouncer, nil
|
return bouncer, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO the ServeHTTP should be split as it's too long.
|
|
||||||
|
|
||||||
// ServeHTTP principal function of plugin.
|
// ServeHTTP principal function of plugin.
|
||||||
func (a *Bouncer) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
|
func (a *Bouncer) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
|
||||||
if !a.enabled {
|
if !a.enabled {
|
||||||
@@ -163,7 +161,6 @@ func (a *Bouncer) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
|
|||||||
|
|
||||||
if a.crowdsecMode == "stream" || a.crowdsecMode == "live" {
|
if a.crowdsecMode == "stream" || a.crowdsecMode == "live" {
|
||||||
isBanned, err := getDecision(remoteHost)
|
isBanned, err := getDecision(remoteHost)
|
||||||
log.Printf("%v, %s", isBanned, err)
|
|
||||||
if err == nil {
|
if err == nil {
|
||||||
if isBanned {
|
if isBanned {
|
||||||
rw.WriteHeader(http.StatusForbidden)
|
rw.WriteHeader(http.StatusForbidden)
|
||||||
|
|||||||
Reference in New Issue
Block a user