mirror of
https://github.com/maxlerebourg/crowdsec-bouncer-traefik-plugin.git
synced 2026-07-21 11:38:59 +02:00
🍱 fix
This commit is contained in:
+7
-3
@@ -21,8 +21,8 @@ const (
|
||||
realIpHeader = "X-Real-Ip"
|
||||
forwardHeader = "X-Forwarded-For"
|
||||
crowdsecAuthHeader = "X-Api-Key"
|
||||
crowdsecRoute = "v1/decisions"
|
||||
crowdsecStreamRoute = "v1/decisions/stream"
|
||||
crowdsecRoute = "v1/decisions"
|
||||
crowdsecStreamRoute = "v1/decisions/stream"
|
||||
cacheBannedValue = "t"
|
||||
cacheNoBannedValue = "f"
|
||||
)
|
||||
@@ -149,7 +149,11 @@ func (a *Bouncer) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
|
||||
}
|
||||
|
||||
if a.crowdsecMode == "stream" {
|
||||
a.next.ServeHTTP(rw, req)
|
||||
if a.crowdsecStreamHealthy {
|
||||
a.next.ServeHTTP(rw, req)
|
||||
} else {
|
||||
rw.WriteHeader(http.StatusForbidden)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user