Skip to content

Commit

Permalink
fixed nil ref to finalResponse
Browse files Browse the repository at this point in the history
  • Loading branch information
SamMHD committed Feb 27, 2024
1 parent 35aedc9 commit a89a620
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions pkg/auth/authenticator.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,16 @@ func (a *Authenticator) Check(ctx context.Context, request *Request) (finalRespo
defer func() {
extraAttrs := []attribute.KeyValue{
attribute.String("cerberus-reason", string(reason)),
attribute.Bool("final-response-ok", finalResponse.Allow),
}
for k, v := range finalResponse.Response.Header {
if finalResponse != nil {
extraAttrs = append(extraAttrs,
attribute.String("final-extra-headers-"+k, strings.Join(v, ",")),
attribute.Bool("final-response-ok", finalResponse.Allow),
)
for k, v := range finalResponse.Response.Header {
extraAttrs = append(extraAttrs,
attribute.String("final-extra-headers-"+k, strings.Join(v, ",")),
)
}
}
tracing.EndSpan(span, start_time, extraAttrs...)
}()
Expand Down

0 comments on commit a89a620

Please sign in to comment.