👷 chore(ci) bump CI and automate dep updates (#210)

* 👷 chore(ci) bump CI and automate dep updates

* 🚨 chore(go) fix golang lint

* 🍱 fix lint

---------

Co-authored-by: Max Lerebourg <maxlerebourg@gmail.com>
This commit is contained in:
mathieuHa
2025-01-29 08:07:04 +01:00
committed by GitHub
co-authored by Max Lerebourg
parent 92f05b0ba5
commit 0e9620bfe9
5 changed files with 39 additions and 25 deletions
+5 -2
View File
@@ -126,7 +126,7 @@ func New(_ context.Context, next http.Handler, config *configuration.Config, nam
apiKey, errAPIKey := configuration.GetVariable(config, "CrowdsecLapiKey")
if errAPIKey != nil && len(tlsConfig.Certificates) == 0 {
log.Error("New:crowdsecLapiKey fail to get CrowdsecLapiKey and no client certificate setup " + errAPIKey.Error())
return nil, err
return nil, errAPIKey
}
config.CrowdsecLapiKey = apiKey
}
@@ -352,7 +352,10 @@ func handleBanServeHTTP(bouncer *Bouncer, rw http.ResponseWriter) {
rw.Header().Set(bouncer.remediationCustomHeader, "ban")
}
rw.WriteHeader(http.StatusForbidden)
fmt.Fprint(rw, bouncer.banTemplateString)
_, err := fmt.Fprint(rw, bouncer.banTemplateString)
if err != nil {
bouncer.log.Error("handleBanServeHTTP could not write template to ResponseWriter")
}
}
func handleRemediationServeHTTP(bouncer *Bouncer, remoteIP, remediation string, rw http.ResponseWriter, req *http.Request) {