From 62daefedfd14d5155545219121311145df92d35f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Mazeau?= Date: Wed, 15 Nov 2023 11:08:15 +0100 Subject: [PATCH] serverless/appsec: use res.HasEvents() --- pkg/serverless/appsec/httpsec/proxy.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/serverless/appsec/httpsec/proxy.go b/pkg/serverless/appsec/httpsec/proxy.go index 9f60ab9b6525b5..7ee8e0c5b54481 100644 --- a/pkg/serverless/appsec/httpsec/proxy.go +++ b/pkg/serverless/appsec/httpsec/proxy.go @@ -237,7 +237,7 @@ func (lp *ProxyLifecycleProcessor) spanModifier(lastReqId string, chunk *pb.Trac log.Debug("appsec: missing span tag http.status_code") } - if res := lp.appsec.Monitor(ctx.toAddresses()); len(res.Events) > 0 { + if res := lp.appsec.Monitor(ctx.toAddresses()); res.HasEvents() { setSecurityEventsTags(span, res.Events, reqHeaders, nil) chunk.Priority = int32(sampler.PriorityUserKeep)