This commit is contained in:
Max Lerebourg
2022-09-29 09:23:29 +02:00
parent 45eca85f3a
commit 75267a1746
+2 -1
View File
@@ -144,6 +144,7 @@ func New(ctx context.Context, next http.Handler, config *Config, name string) (h
} }
// TODO the serve HTTP should be split as it's too long. // TODO the serve HTTP should be split as it's too long.
// 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 {
log.Printf("Crowdsec Bouncer not enabled") log.Printf("Crowdsec Bouncer not enabled")
@@ -244,7 +245,7 @@ func (a *Bouncer) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
// Decision: Body returned from Crowdsec LAPI. // Decision: Body returned from Crowdsec LAPI.
type Decision struct { type Decision struct {
Id int `json:"id"` ID int `json:"id"`
Origin string `json:"origin"` Origin string `json:"origin"`
Type string `json:"type"` Type string `json:"type"`
Scope string `json:"scope"` Scope string `json:"scope"`